Does anyone know how to include dynamic values for the 
name/value pairs inside struts tags?

e.g.

<html:checkbox onclick="monitorCheckBoxes(this.form,<%= i %
>,2)" name="prodActForm" property="property(<%= "c_" + i 
= "_2")" />

I am trying to dynamically generate rows of checkboxes 
similar to below:

 --   --
 | |  | |
 --   --

 --   --
 | |  | |
 --   --

 --   --
 | |  | |
 --   --

 --   --
 | |  | |
 --   --


I have a form bean with a setProperty(String, String) and a 
getProperty(String).

I want to dynamically generate the names of the checkboxes so 
that the end result is: 

formBean.setProperty("c_0_1",<value>);
formBean.setProperty("c_0_2",<value>);
formBean.setProperty("c_1_1",<value>);
formBean.setProperty("c_1_2",<value>);
formBean.setProperty("c_2_1",<value>);
formBean.setProperty("c_2_2",<value>);
formBean.setProperty("c_3_1",<value>);
formBean.setProperty("c_3_2",<value>);

where <value> is the value of the checkbox from the form.  Of 
course, it would only be called if the checkbox had a value.  
But my problem is i can't get the HTML to display correctly.

This for example comes out as: 

<html:checkbox onclick="monitorCheckBoxes(this.form,<%= i %
>,2)" name="prodActForm" property="property(xyx)" />


<input type="checkbox" name="property(xyz)" value="on" 
onclick="monitorCheckBoxes(this.form,<%= i %>,2)">


As you can see it actuall prints the string: "<%= i %>" 
versus the value of "i" that i want.

Can anyone help?



Thanks kindly!

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

Reply via email to