Validators

View: New views
3 Messages — Rating Filter:   Alert me  

Validators

by Ilya Ermolov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello! I have problem using validators in Woodstock components.

I have 2 drop down lists (webuijsf:dropDown) and thier content must be different.
How to solve this problem?

I implemented Validator interface, but validate method can't read information from other drop down.

Re: Validators

by Mike Kienenberger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can either use the validateCompareTo component as found in the
Tomahawk sandbox release, which has now migrated to Tomahawk proper,
and is in the process of migrating to the Myfaces-commons-validators
project,

http://myfaces.apache.org/sandbox/validateCompareTo.html

or

You can use the code there to create your own -- either copy the
entire validator or just the parts you want, such as how to read
information from other input components.

http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/comparetovalidator/AbstractCompareToValidator.java?revision=668332&view=markup


On 6/17/08, Ilya Ermolov <ilya-ermolov-java@...> wrote:

>
>  Hello! I have problem using validators in Woodstock components.
>
>  I have 2 drop down lists (webuijsf:dropDown) and thier content must be
>  different.
>  How to solve this problem?
>
>  I implemented Validator interface, but validate method can't read
>  information from other drop down.
>
> --
>  View this message in context: http://www.nabble.com/Validators-tp17879803p17879803.html
>  Sent from the javaserverfaces dev mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@...
>  For additional commands, e-mail: dev-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Validators

by Ilya Ermolov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Ilya Ermolov wrote:
Hello! I have problem using validators in Woodstock components.

I have 2 drop down lists (webuijsf:dropDown) and thier content must be different.
How to solve this problem?

I implemented Validator interface, but validate method can't read information from other drop down.
I invented simple solution. I binded my component with DropDown object in bean. Then created method dropDown_validate and used it in validatorExpresion property. In dropDown_validate I compare new value and selectedValue of second dropDown in binded object.
LightInTheBox - Buy quality products at wholesale price