Read Struts parametes in javascript

I am extracting a list of objects using logic:iterate (list is in session). Those objects hava a property called "name". Using the iteration, I draw a TABLE. Each row constains the object name and a submit button. The submit button has a javascript function, that shoul recieve object's name as a parameter, but I don't know how to do it.

<table>

<logic:iterate id="mylist" name="myobject" scope="session">

<tr>

<td><bean:write id="myobject" property="name"/></td>

<td><html:submit value="process" onclick="return doProcess(OBJECT_NAME_GOES_HERE)" />

</logic:iterate>

</table>

How do I pass the object's name inside doProcess()?

I know I might use a normal HTML INPUT to draw the submit, and put the text with <bean:write .../>, but if possible, I'd like to do it with struts tags

[1086 byte] By [roberjruiza] at [2007-11-27 2:39:29]
# 1

I guess this is the only way to pass your name to the javascript function if you want to pass a value inside an iterator:

<html:submit value="process" onclick='return doProcess(<bean:write id="myobject" property="name"/>)' />

SirG

SirGenerala at 2007-7-12 3:01:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I am the original poster (some problems with the other nick)

I tried the way you told me, but the inner <bean:write> tag, is not translated, and appears as is in browser source code. Anyway, I found a way. I don't know if this is pure Struts, but it works:

<table>

<logic:iterate id="mylist" name="myobject" scope="session">

<tr>

<td><bean:write id="myobject" property="name"/></td>

<td><html:submit value="process" onclick="return doProcess('${myobject.name}')" />

</logic:iterate>

</table>

rober2d2a at 2007-7-12 3:01:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...