here is my question again .I have a drop down choice with list of Item
objects , If I submit the form the form model object gets updated and I get
the selected item from the form model object. but I have a form validator
that gets called before form model object is updated in validator If I want
to retrieve the selected item , please tell me how can I do this ?
fachhoch wrote:
>
> I have a dropdown choice with values from enum . In form validation if
> the
> selected value from list is monetarty , then amount field also needs value
> ,
> now my problem is how would I get the selected value in the
> validator
> object
>
> <code>
>
> add(new
> DropDownChoice<FindingTypeEnum>("findingType",Arrays.asList(FindingTypeEnum.values())));
> //validator
>
> if(FindingTypeEnum.Monetry.equals(getFormComponent("findingType").getValue())){
>
> if(StringUtils.isBlank(getFormComponent("findingAmt").getValue())){
> addErrorMessage("Finding Amount is required
> for finding type monetary");
> }
> }
>
> </code>
>
> here in the code getFormComponent("findingType").getValue() return
> index
> of selected value but not the selected object , please tell me If I can
> retrieve the selected object from dropdownchoice ?
>
>
--
View this message in context:
http://www.nabble.com/validation-for-select-tp24189224p24204604.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]