Hi,

I have a form-property like so:
<form-property name="PropertyName" type="java.lang.String[]" size="5"/>

Which is populated by the following in my jsp page:

<logic:iterate id="element" name="MyForm" property="PropertyName"
indexId="counter">
  <tr>
    <td class="firstCol"><bean:message key='MyForm.PropertyName'/>:</td>
    <td class="lastCol">
      <html:select property='<%="PropertyName[" + counter + "]" %>'>
        <html:option key="select.default" value=""/>
        <logic:notEmpty name="MyForm" property="PropertyName_refData">
          <html:options property="PropertyName_refData" ></html:options>
        </logic:notEmpty>
      </html:select>
    </td>
  </tr>
</logic:iterate>
<tr>
  <td>&nbsp;</td>
  <td>
    <html:errors property="PropertyName"/>
  </td>
</tr>

This works fine as I get the 5 html:selects on the page. However, I want to
validate this and check that at least 1 of the 5 have been specified. I've
tried the following in validation.xml but am getting unexpected token errors
and I can't figure out how to do my validation.

<field property="PropertyName" indexedListProperty="PropertyName"
depends="validwhen">
  <arg0 key="MyForm.PropertyName"/>
  <var>
    <var-name>test</var-name>
    <var-value>((PropertyName[0] != null) or (*this* != null))</var-value>
  </var>
</field>

Any suggestions as to how I can validate that at least 1 has been specified
would be most welcome!

Cheers
Paul


************************************************************************
This message should be regarded as confidential. If you have received this 
email in error please notify the sender and destroy it immediately.
Statements of intent shall only become binding when confirmed in hard copy by 
an authorised signatory.

Detica Limited is registered in England under No: 1337451 and Detica (Rubus) 
Limited under No: 03361831.

Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, England.
************************************************************************

Reply via email to