In the logic-el:iterate you defined the bean to scope with the id attribute, but then don't reference it in the form element
<html-el:checkbox name="acct" property="accounts" indexed="true" />
I'd consider not storing the formbeans in a map as you don't need to get the values out with a key. I provided an example of how to do this in this thread even making an arrayList of dynaactionforms will work.
cheers Mark
On 12 Jan 2004, at 21:27, Wendy Smoak wrote:
From: Wendy Smoak Apparently you don't have to use logic-el:iterate with html-el:checkbox & indexed="true". This works: <c:forEach items="${accountMap[accountForm.map.calendarYear]}" var="account" > <html-el:checkbox property="accounts" indexed="true">
I lied, that doesn't work at all. It produces HTML like this:
<input type="checkbox" name="org.apache.struts.taglib.html.BEAN[0].accounts" value="on">10_U_FADA0001
I read that indexed properties only work with logic:iterate, so I'm
trying to change over from logic:forEach. Can someone help me sort this
out?
This works to generate HTML, but BeanUtils can't populate the ArrayList that is the 'accounts' property of accountForm because the bracketed [] indexes are missing.
<logic-el:iterate collection="${accountMap[accountForm.map.calendarYear]}" id="acct" indexId="ctr"> <html-el:checkbox property="accounts" > <c:out value="${acct.key}"/> </html-el:checkbox> ...
However, if I add indexed="true" like so:
<logic-el:iterate collection="${accountMap[accountForm.map.calendarYear]}" id="acct" indexId="ctr"> <html-el:checkbox property="accounts" indexed="true"> <c:out value="${acct.key}"/> </html-el:checkbox>
It renders this HTML: <input type="checkbox" name="org.apache.struts.taglib.html.BEAN[0].accounts" value="on">10_U_FADA0001
??! This is my first attempt at indexed properties, which apparently I
need in order to use an ArrayList. (The items in the ArrayList are just
Strings, not complex objects. This isn't nested properties, it's just a
bunch of checkboxes. I'm trying to use ArrayList instead of String[] to
avoid out of bounds errors. String[] was working *fine* last week,
until I got the bright idea to use ArrayList.)
I'm getting the feeling that the things in the ArrayList property of the
form have to be complex objects and not just Strings.
-- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]