struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "El Harouchi, Jaafar [IT]" <jaafar.elharou...@citigroup.com>
Subject RE: iteration to create dynamic form
Date Thu, 26 Jun 2003 06:59:05 GMT
try with multibox instead of checkbox:
	http://jakarta.apache.org/struts/struts-html.html#multibox
-jaafar


-----Original Message-----
From: Piers Dunleavy [mailto:pdaniell@ign.com]
Sent: Thursday, June 26, 2003 2:32 AM
To: Struts Users Mailing List
Subject: iteration to create dynamic form


I have a <logic:iterate> tag which is supposed to create a dynamic form, filled with
a checkbox for every object in a collection. (The checkbox is an option to delete one of those
records from the database.) The form itself is a Map-Backed Action form with two methods (public
void setValue(String key, Object value) and public Object getValue(String key)). 


<logic:iterate id="record" name="user" property="siteSection.newRecords">

<%
(dataobjects.Record) l = (dataobjects.Record)pageContext.findAttribute("record");
String name= new String("value(" + r.getID()+")");
%>
<tr" height="30">
<td align="center">
<html:checkbox value="off" property="<%=name%>" onclick="CheckMBRow(this)"/>
</td> <td> ..other stuff describing the record..</td>
</tr>
</logic:iterate>

Is there a way in Struts to do this without calling the "record" object from the pageContext?
Can't I get the <html:checkbox> tag to recognize the 'record' bean directly without
using that scriptlet and then creating a String to set the appropriate mapped value? 

Best,
Piers

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message