You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by daniel ccss <da...@gmail.com> on 2007/08/16 22:48:30 UTC

2 problems (JSF+Tomahawk)

Hi all, I think I have found 2 problems (JSF+Tomahawk)

1- If the property readonly of a <h:selectOneMenu is set to true, and in the
backing_bean when i try to get the value of the selectOneMenu item I always
get a 0, if i set readonly to false, I get the correct value of the
<h:selectOneMenu

2-If a property in the JSP don´t have the required property to true either a
validator nor a converter can be applied to it. It seem only the required
properties can be validates, but what if I want to apply a validator to a
property when it has a value?

Re: 2 problems (JSF+Tomahawk)

Posted by David Delbecq <de...@oma.be>.
En l'instant précis du 18/08/07 05:02, daniel ccss s'exprimait en ces
termes:
>
> Yes I understand the concept that the validator and converter are only
> called when the required attribut is set to true (don`t agree with
> that concept) so I made the validation of this not required values on
> the backing_bean
>
That's not what i said. Validation occurs only if you submit an non
empty value. You can prevent user from submitting empty values by
setting a required="true" to component.


-- 
http://www.noooxml.org/


Re: 2 problems (JSF+Tomahawk)

Posted by daniel ccss <da...@gmail.com>.
What I did for fix the problem was change the readonly Select for a readonly
input and now all works great, but is a bug no doubt about it :P

On 8/17/07, daniel ccss <da...@gmail.com> wrote:
>
> 1- I the component is readonyl, it will never update the backing bean's
> value. That mean the value of your getXxx() in you backing bean will be
> the same you initialized it with programmatically
>
> Nop, the value before is 21, if the select is not readonly then the value
> I get is 21 if is readonly is 0
>
> 2-For the validators and converters to be called, there must be a non
> empty submitted value. The fact your validator don't get called if you
> don't set required to true is due to you submitting an empty value for
> your component. For example, if you set a validator that check email
> correctness and you *don't* set the required attribute on h:inputText,
> the form will be valid if user submit a correct email *or* user don't
> fill the email field.
>
> Yes I understand the concept that the validator and converter are only
> called when the required attribut is set to true (don`t agree with that
> concept) so I made the validation of this not required values on the
> backing_bean
>
>
>
>
> On 8/17/07, David Delbecq <de...@oma.be> wrote:
> >
> > En l'instant précis du 16/08/07 22:48, daniel ccss s'exprimait en ces
> > termes:
> > > Hi all, I think I have found 2 problems (JSF+Tomahawk)
> > >
> > > 1- If the property readonly of a <h:selectOneMenu is set to true, and
> > > in the backing_bean when i try to get the value of the selectOneMenu
> > > item I always get a 0, if i set readonly to false, I get the correct
> > > value of the <h:selectOneMenu
> > I the component is readonyl, it will never update the backing bean's
> > value. That mean the value of your getXxx() in you backing bean will be
> > the same you initialized it with programmatically
> > >
> > > 2-If a property in the JSP don´t have the required property to true
> > > either a validator nor a converter can be applied to it. It seem only
> > > the required properties can be validates, but what if I want to apply
> > > a validator to a property when it has a value?
> > For the validators and converters to be called, there must be a non
> > empty submitted value. The fact your validator don't get called if you
> > don't set required to true is due to you submitting an empty value for
> > your component. For example, if you set a validator that check email
> > correctness and you *don't* set the required attribute on h:inputText,
> > the form will be valid if user submit a correct email *or* user don't
> > fill the email field.
> >
> >
> > --
> > http://www.noooxml.org/
> >
> >
>

Re: 2 problems (JSF+Tomahawk)

Posted by daniel ccss <da...@gmail.com>.
1- I the component is readonyl, it will never update the backing bean's
value. That mean the value of your getXxx() in you backing bean will be
the same you initialized it with programmatically

Nop, the value before is 21, if the select is not readonly then the value I
get is 21 if is readonly is 0

2-For the validators and converters to be called, there must be a non
empty submitted value. The fact your validator don't get called if you
don't set required to true is due to you submitting an empty value for
your component. For example, if you set a validator that check email
correctness and you *don't* set the required attribute on h:inputText,
the form will be valid if user submit a correct email *or* user don't
fill the email field.

Yes I understand the concept that the validator and converter are only
called when the required attribut is set to true (don`t agree with that
concept) so I made the validation of this not required values on the
backing_bean




On 8/17/07, David Delbecq <de...@oma.be> wrote:
>
> En l'instant précis du 16/08/07 22:48, daniel ccss s'exprimait en ces
> termes:
> > Hi all, I think I have found 2 problems (JSF+Tomahawk)
> >
> > 1- If the property readonly of a <h:selectOneMenu is set to true, and
> > in the backing_bean when i try to get the value of the selectOneMenu
> > item I always get a 0, if i set readonly to false, I get the correct
> > value of the <h:selectOneMenu
> I the component is readonyl, it will never update the backing bean's
> value. That mean the value of your getXxx() in you backing bean will be
> the same you initialized it with programmatically
> >
> > 2-If a property in the JSP don´t have the required property to true
> > either a validator nor a converter can be applied to it. It seem only
> > the required properties can be validates, but what if I want to apply
> > a validator to a property when it has a value?
> For the validators and converters to be called, there must be a non
> empty submitted value. The fact your validator don't get called if you
> don't set required to true is due to you submitting an empty value for
> your component. For example, if you set a validator that check email
> correctness and you *don't* set the required attribute on h:inputText,
> the form will be valid if user submit a correct email *or* user don't
> fill the email field.
>
>
> --
> http://www.noooxml.org/
>
>

Re: 2 problems (JSF+Tomahawk)

Posted by David Delbecq <de...@oma.be>.
En l'instant précis du 16/08/07 22:48, daniel ccss s'exprimait en ces
termes:
> Hi all, I think I have found 2 problems (JSF+Tomahawk)
>  
> 1- If the property readonly of a <h:selectOneMenu is set to true, and
> in the backing_bean when i try to get the value of the selectOneMenu
> item I always get a 0, if i set readonly to false, I get the correct
> value of the <h:selectOneMenu
I the component is readonyl, it will never update the backing bean's
value. That mean the value of your getXxx() in you backing bean will be
the same you initialized it with programmatically
>  
> 2-If a property in the JSP don´t have the required property to true
> either a validator nor a converter can be applied to it. It seem only
> the required properties can be validates, but what if I want to apply
> a validator to a property when it has a value?
For the validators and converters to be called, there must be a non
empty submitted value. The fact your validator don't get called if you
don't set required to true is due to you submitting an empty value for
your component. For example, if you set a validator that check email
correctness and you *don't* set the required attribute on h:inputText,
the form will be valid if user submit a correct email *or* user don't
fill the email field.


-- 
http://www.noooxml.org/