Actually, i came up with another work around.  Although, it 
does involves scriptlets.....

before i declare the <html:checkbox /> tag, i do something 
like the following:

<% String v_onClick = "foo(1,2," + i + ")"; %>

then i can do the following:

<html:checkbox ..... onclick="<%= v_onClick %>" ... />

to get the dynamic value of the variable "i"....or whatever 
other variables i might require.


A co-worker also mentioned not using the struts tags for 
checkboxes.......i'll work with both until i feel which one 
fits best.


thanks!



---- Original message ----
>Date: Thu, 16 May 2002 13:34:47 -0400
>From: "Michael Marrotte" <[EMAIL PROTECTED]>  
>Subject: RE: Help!: Dynamic Property Name and JavaScript 
values  
>To: "Struts Users Mailing List" <struts-
[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>
>Since Struts tags can't be nested.  Nest Struts "dynamic" 
<bean:write>'s
>inside plain HTML tags.
>
><input type="checkbox" name="prodActForm_<bean:write 
name="yourName"
>property="yourProperty"/>">
>
>
>I have successfully tackeled this problem from a few 
different angles...
>Let me know if this helps, or not...
>
>Michael Marrotte
>
>-----Original Message-----
>From: Jeremy Prellwitz [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, May 16, 2002 12:48 PM
>To: [EMAIL PROTECTED]
>Subject: Help!: Dynamic Property Name and JavaScript values
>
>
>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]>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:struts-user-
[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:struts-user-
[EMAIL PROTECTED]>
>

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

Reply via email to