Hi,

if you use xml validation, you should use  a validator like this one :

<validator type="int">
    <param name="fieldName">mySelectBox</param>
    <param name="min">0</param>
    <message>Please select a value</message>
</validator>

As your default value is -1, the validator will only check if the value is not -1. For the rest of the values, there won't be any other check.

If you use annotation validation, there is a very similar way to define that even if i didn't use it (so i won't try to write something).

Hope i helped you

Regards

Sébastien

Naag a écrit :
hi to everybody...

i am getting the problem with validating the filed which contains the drop
down box. from the box we can select the item to the field.
the headerkey="-1" header value="select one item".
how to validate these type of fileds.


my problem is-----------?

if didn't select any item from the dropdown box,then the default value is
---select One item

if the filed contains the select one item,then how validate this one from
validation.xml file?
if have been selected any one of the items,no validation is required.
--------jsp
<s:select key="Use Existing Group" list="groupNames" name="useExistingGroup"
emptyOption="false" headerKey="0" headerValue="Select Group Name" />

---------action class variable
private List<String> groupNames = new ArrayList<String>();


please send me the clue for this one.
i tried in all the ways,but i am helpless

Thanking u




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to