I have a form with a checkboxlist linked to a bean with an array of string 
properties. I want the user must select at least one option.

Looking for the documentation, i think this is possible with field expression, 
but it requires ONGL expression.

I did it so:

FORM

<s:form action=“register”>
…
   <s:checkboxlist key=levels/>
…
</s:form>


BEAN 
public class Person{

    private String[] levels;
…
}


XML VALIDATION
<validator>
   <field name=person.levels>
        <field-validator type=fieldexpression>
            <param name=“expression”><![CDATA[person.levels.length==0]]></param>
            <message>Selecciona al menos un curso</message>
       </field-validator>
  </field>
</validator

After that the first submit without selection i see the error field message. 
But if i select one options and submit i still see the error. Why??




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to