You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Abrams, Howard A" <Ho...@ca.com> on 2005/03/03 23:21:44 UTC

Problem with UIInput's 'validate'

Hi,

I've been playing around with some custom components and I ran into a
problem with myFaces 1.0.8 (vs. the Sun reference implementation). I
wanted to bring it up to the list before I created a new issue.

In the reference implementation, UIInput has a protected method
'validateValue'. By default it does some basic checks including checking
the 'required' property, calling the validators, etc. It can be
overridden without messing with the basics of validation (getting the
converted value, firing a valueChange event, etc). In myFaces, this has
all been lumped into 'validate'. This means to tweak the validation of a
custom component based on UIInput, you must re-implement all of
'validate', including all the basics. To make matters worse,
'getConvertedValue' is private in myFaces (it is protected in the RI),
so you must re-implement all of that method as well (and call it
something else).  

According to the 1.1 spec, 'validate' must "Perform the algorithm
described in the javadoc to validate the local value of this UIInput",
and the 1.1 javadoc. The javadoc in-turn mentions 'validateValue', etc,
etc.  

I'd like to modify UIInput to:
1. Add a protected method 'validateValue', and change the 'validate'
implementation to use it
2. Change 'getConvertedValue' from private to protected

Does anyone have an opinion on this?

Thanks in advance,
h.

Howard Abrams, Ph.D.
Computer Associates
Senior Architect
howard.abrams@ca.com 



Re: Problem with UIInput's 'validate'

Posted by Heath Borders <he...@gmail.com>.
I would personally rather see our API methods match the RI's API
methods exactly, for better code compliance.


On Thu, 3 Mar 2005 17:21:44 -0500, Abrams, Howard A
<Ho...@ca.com> wrote:
> Hi,
> 
> I've been playing around with some custom components and I ran into a
> problem with myFaces 1.0.8 (vs. the Sun reference implementation). I
> wanted to bring it up to the list before I created a new issue.
> 
> In the reference implementation, UIInput has a protected method
> 'validateValue'. By default it does some basic checks including checking
> the 'required' property, calling the validators, etc. It can be
> overridden without messing with the basics of validation (getting the
> converted value, firing a valueChange event, etc). In myFaces, this has
> all been lumped into 'validate'. This means to tweak the validation of a
> custom component based on UIInput, you must re-implement all of
> 'validate', including all the basics. To make matters worse,
> 'getConvertedValue' is private in myFaces (it is protected in the RI),
> so you must re-implement all of that method as well (and call it
> something else).
> 
> According to the 1.1 spec, 'validate' must "Perform the algorithm
> described in the javadoc to validate the local value of this UIInput",
> and the 1.1 javadoc. The javadoc in-turn mentions 'validateValue', etc,
> etc.
> 
> I'd like to modify UIInput to:
> 1. Add a protected method 'validateValue', and change the 'validate'
> implementation to use it
> 2. Change 'getConvertedValue' from private to protected
> 
> Does anyone have an opinion on this?
> 
> Thanks in advance,
> h.
> 
> Howard Abrams, Ph.D.
> Computer Associates
> Senior Architect
> howard.abrams@ca.com
> 
> 


-- 
-Heath Borders-Wing
hborders@mail.win.org