You'll have to set the "indexed" property to true in all child tags within the 
iterator...

<html:text name="someBean" property="comment" indexed="true"

Or... you can use nested tags and it's all done for you, no matter what child 
tags your using, and you can also forget having to set a bean with the id 
attribute etc etc etc. Easier and more flexible (not just limited to indexed, 
they can also provide mapped properties just as easily). What's more, it's in 
Struts 1.1b, or available separately for older Struts versions.

Primer and tutorials...
www.keyboardmonkey.com/next

Arron.


On Wed, 15 May 2002 12:03 am, Tandon, Pankaj wrote:
> Hello,
> I need to display an unknown number of input fields to the user within a
> logic:iterate tag.
> The field corresponds to a form property 'comment', say.
> So in the corresponding Struts form I will need to have a getter and setter
> that sets and gets a String AND a Collection like so:
> public void setComment(String s) {comment = s;}
> public String getComment(){return comment;}
> AND
> public void setComments(Collection c) {comments = c;}
> public Collection getComment(){return comments;}
> The question is, if my tag looks like this:
> <logic:iterate id="aRow" type="com.company.ABean" name=aBean" >
>    Enter your comment here:<html:text property="comment" />
> </logic:iterate>
> how will my comments property setter get called automatically?
> (notice comments, not comment).
> Maybe I shd be using <html:text property="comments" />  instead of
> <html:text property="comment" />
>
>
> Is there a sample for this kind of processing?
>
> Thanks IA
> Pankaj


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

Reply via email to