I'm having a problem when attempting to validate, when using dynamic checkboxes on a 
page. The problem is that after validation the JSP loses context to a collection that 
was previously part of the form.

The checkboxes are built from values in a database and are likely to change often. 
Along with the need to display the checkbox value (idValue), I need to display a 
related label(Product Name) as well. Example:

Product name1   valueId1(checkbox)
Product name2   valueId2(checkbox)

To achieve this I use a collection containing objects similar to the LabelValueBean, 
then use an Iterate tag to display labels and checkboxes.

The problem
----------------
Problem is that when I go to validate (using wintecinc) another Text field on the page 
the collection loses its data when the validator returns with errors. Here's the 
snippet of code that's causing this problem:


Code sample begins
--------------------------
<bean:define id="listing" name="editForm" property="settingsInput.listProd"/>
<logic:iterate id="element" name="listing">
<tr>
<td >
<bean:write name="element" property="label"/></td>
<td>
<input type='checkbox' name='<bean:write name="editForm" 
property="settingsInput.prodIdPrefix"/><bean:write name="element" 
property="value"/>'></td>
</tr>
</logic:iterate>

//listing is a collection of label <-> values


Code sample ends
------------------------

I can't use the html:checkbox type because the checkboxes are being built dynamically, 
even if I did use it how can I keep the collection in state after the validation is 
done.

I've looked at the Indexed tag approach, but the need to display a label nixxes that.

Does anyone have any ideas? This is pretty urgent (as usual). Thanks in advance

Ady




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

Reply via email to