You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by C Chang <it...@gmail.com> on 2009/04/27 11:00:49 UTC

[Trinidad]How to do dynamic form validation?

 Dear all,
I have a form which has two <tr:inputText> elements, if first element has
value, then the second element must have value as well. If first element
doesn't have value, then the second element is optional.

Vice versa, if the second element has value, then the first element must
have value. If the second element doesn't have value, then the first element
is optional.

How can I implement this in trinidad? Thanks in advance!

Kind regards,
Leon

Re: [Trinidad]How to do dynamic form validation?

Posted by C Chang <it...@gmail.com>.
I just tried ExtVal, and it worked! Thank you guys!!
Leon

On Mon, Apr 27, 2009 at 9:26 PM, C Chang <it...@gmail.com> wrote:

> Thanks a lot! I'll take a look at ExtVal framework. Hope it can solve my
> problem. :)
> Leon
>
>
> On Mon, Apr 27, 2009 at 5:29 PM, Matthias Wessendorf <ma...@apache.org>wrote:
>
>> does not help
>>
>> on initial rendering, when both values ARE null, there is required than
>>
>> He wants to do some more advanced validation, based on IF there were
>> actually values submitted.
>>
>> I'd use the ExtVal framework for that
>>
>> -M
>>
>> On Mon, Apr 27, 2009 at 11:26 AM, Döring Markus
>> <Ma...@tcc-products.de> wrote:
>> > Hi,
>> >
>> > I didn’t tested it, but maybe something like this works for you:
>> >
>> >
>> >
>> > <tr:inputText label=”textfield1” value=”#{value1}” required=”#{value2 !=
>> > null}”>
>> >
>> > <tr:inputText label=”textfield2” value=”#{value2}” required=”#{value1 !=
>> > null}”>
>> >
>> >
>> >
>> > Maybe you have to replace “valueX != null” with some kind of
>> > “isNotBlank(valueX)” and you have to add some PPR stuff to update
>> textfield2
>> > if value of textfield1 changess (and vice versa)
>> >
>> >
>> >
>> >
>> >
>> > Von: C Chang [mailto:itsmrchang@gmail.com]
>> > Gesendet: Montag, 27. April 2009 11:01
>> > An: users@myfaces.apache.org
>> > Betreff: [Trinidad]How to do dynamic form validation?
>> >
>> >
>> >
>> > Dear all,
>> >
>> >
>> >
>> > I have a form which has two <tr:inputText> elements, if first element
>> has
>> > value, then the second element must have value as well. If first element
>> > doesn't have value, then the second element is optional.
>> >
>> >
>> >
>> > Vice versa, if the second element has value, then the first element must
>> > have value. If the second element doesn't have value, then the first
>> element
>> > is optional.
>> >
>> >
>> >
>> > How can I implement this in trinidad? Thanks in advance!
>> >
>> >
>> >
>> > Kind regards,
>> >
>> > Leon
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>>
>
>

Re: [Trinidad]How to do dynamic form validation?

Posted by C Chang <it...@gmail.com>.
Thanks a lot! I'll take a look at ExtVal framework. Hope it can solve my
problem. :)
Leon

On Mon, Apr 27, 2009 at 5:29 PM, Matthias Wessendorf <ma...@apache.org>wrote:

> does not help
>
> on initial rendering, when both values ARE null, there is required than
>
> He wants to do some more advanced validation, based on IF there were
> actually values submitted.
>
> I'd use the ExtVal framework for that
>
> -M
>
> On Mon, Apr 27, 2009 at 11:26 AM, Döring Markus
> <Ma...@tcc-products.de> wrote:
> > Hi,
> >
> > I didn’t tested it, but maybe something like this works for you:
> >
> >
> >
> > <tr:inputText label=”textfield1” value=”#{value1}” required=”#{value2 !=
> > null}”>
> >
> > <tr:inputText label=”textfield2” value=”#{value2}” required=”#{value1 !=
> > null}”>
> >
> >
> >
> > Maybe you have to replace “valueX != null” with some kind of
> > “isNotBlank(valueX)” and you have to add some PPR stuff to update
> textfield2
> > if value of textfield1 changess (and vice versa)
> >
> >
> >
> >
> >
> > Von: C Chang [mailto:itsmrchang@gmail.com]
> > Gesendet: Montag, 27. April 2009 11:01
> > An: users@myfaces.apache.org
> > Betreff: [Trinidad]How to do dynamic form validation?
> >
> >
> >
> > Dear all,
> >
> >
> >
> > I have a form which has two <tr:inputText> elements, if first element has
> > value, then the second element must have value as well. If first element
> > doesn't have value, then the second element is optional.
> >
> >
> >
> > Vice versa, if the second element has value, then the first element must
> > have value. If the second element doesn't have value, then the first
> element
> > is optional.
> >
> >
> >
> > How can I implement this in trinidad? Thanks in advance!
> >
> >
> >
> > Kind regards,
> >
> > Leon
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>

Re: [Trinidad]How to do dynamic form validation?

Posted by Matthias Wessendorf <ma...@apache.org>.
does not help

on initial rendering, when both values ARE null, there is required than

He wants to do some more advanced validation, based on IF there were
actually values submitted.

I'd use the ExtVal framework for that

-M

On Mon, Apr 27, 2009 at 11:26 AM, Döring Markus
<Ma...@tcc-products.de> wrote:
> Hi,
>
> I didn’t tested it, but maybe something like this works for you:
>
>
>
> <tr:inputText label=”textfield1” value=”#{value1}” required=”#{value2 !=
> null}”>
>
> <tr:inputText label=”textfield2” value=”#{value2}” required=”#{value1 !=
> null}”>
>
>
>
> Maybe you have to replace “valueX != null” with some kind of
> “isNotBlank(valueX)” and you have to add some PPR stuff to update textfield2
> if value of textfield1 changess (and vice versa)
>
>
>
>
>
> Von: C Chang [mailto:itsmrchang@gmail.com]
> Gesendet: Montag, 27. April 2009 11:01
> An: users@myfaces.apache.org
> Betreff: [Trinidad]How to do dynamic form validation?
>
>
>
> Dear all,
>
>
>
> I have a form which has two <tr:inputText> elements, if first element has
> value, then the second element must have value as well. If first element
> doesn't have value, then the second element is optional.
>
>
>
> Vice versa, if the second element has value, then the first element must
> have value. If the second element doesn't have value, then the first element
> is optional.
>
>
>
> How can I implement this in trinidad? Thanks in advance!
>
>
>
> Kind regards,
>
> Leon



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

AW: [Trinidad]How to do dynamic form validation?

Posted by Döring Markus <Ma...@tcc-products.de>.
Hi,

I didn't tested it, but maybe something like this works for you:

 

<tr:inputText label="textfield1" value="#{value1}" required="#{value2 != null}">

<tr:inputText label="textfield2" value="#{value2}" required="#{value1 != null}">

 

Maybe you have to replace "valueX != null" with some kind of "isNotBlank(valueX)" and you have to add some PPR stuff to update textfield2 if value of textfield1 changess (and vice versa)

 

 

Von: C Chang [mailto:itsmrchang@gmail.com] 
Gesendet: Montag, 27. April 2009 11:01
An: users@myfaces.apache.org
Betreff: [Trinidad]How to do dynamic form validation?

 

Dear all,

 

I have a form which has two <tr:inputText> elements, if first element has value, then the second element must have value as well. If first element doesn't have value, then the second element is optional.

 

Vice versa, if the second element has value, then the first element must have value. If the second element doesn't have value, then the first element is optional.

 

How can I implement this in trinidad? Thanks in advance!

 

Kind regards,

Leon


Re: [Trinidad]How to do dynamic form validation?

Posted by Matthias Wessendorf <ma...@apache.org>.
I'd check out ExtVal, from MyFaces as well:

http://myfaces.apache.org/extensions/validator/index.html



On Mon, Apr 27, 2009 at 11:00 AM, C Chang <it...@gmail.com> wrote:
> Dear all,
> I have a form which has two <tr:inputText> elements, if first element has
> value, then the second element must have value as well. If first element
> doesn't have value, then the second element is optional.
> Vice versa, if the second element has value, then the first element must
> have value. If the second element doesn't have value, then the first element
> is optional.
> How can I implement this in trinidad? Thanks in advance!
> Kind regards,
> Leon



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf