Once again solved my own problem minutes after posting about it.. lol..
anyway for anyone else that searches this down the road.
It is ESSENTIAL in your form that your method for getting one element from
the list your iterating over matches your variable name in the jsp your
using or what not. Example:
<logic:iterate name="userForm" property="forumGroups" id="forumGroup">
<tr><td width="1%"><html-el:checkbox name="forumGroup" property="available"
indexed="true"/></td>
<td width="25%" nowrap><html-el:hidden name="forumGroup" property="id"
indexed="true" write="false"/>
<html-el:hidden name="forumGroup" property="name" indexed="true"
write="true"/></td>
<td><html-el:hidden name="forumGroup" property="description" indexed="true"
write="true"/></td></tr>
</logic:iterate>
notice my arraylist is named forumGroups, and each object in that array is
assigned as forumGroup. Therefore my method in the form that takes the
index as its parameter to return that object from the arraylist MUST be
named getForumGroup(int index).
-David
----- Original Message -----
From: "David Erickson" <[EMAIL PROTECTED]>
To: "Struts Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, November 03, 2003 4:12 PM
Subject: Indexed Array List Properties (Repost)
> So I've been doing Indexed Arraylist Properties for awhile now but when I
> tried to add some more to my form I'm a little miffed. Here's the array
> List code in my form:
>
> private ArrayList forumGroups = new ArrayList();
>
> now its a request scoped form, so I know I need a method that looks like
> this:
>
> public ForumGroupLine getForumGroup(int index) {
>
> while (index >= this.forumGroups.size())
>
> this.forumGroups.add(new ForumGroupLine());
>
> return (ForumGroupLine) this.forumGroups.get(index);
>
> }
>
>
>
> However I can't figure out what to name it! is the method supposed to be
> named getForumGroup? How does struts determine what to call to just get a
> singular item from an array list? On my other stuff my Arraylist was
named
> roles and my method for getting a single one was just getRole..
>
> Thanks in advance,
>
> David
>
>
> ---------------------------------------------------------------------
> 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]