Thanks so much Bill, that worked beautifully.
Regards,
John
|---------+---------------------------->
| | Bill Siggelkow |
| | <[EMAIL PROTECTED]|
| | th.net> |
| | Sent by: news |
| | <[EMAIL PROTECTED]|
| | rg> |
| | |
| | |
| | 10/07/2004 01:12 |
| | AM |
| | Please respond to|
| | "Struts Users |
| | Mailing List" |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Subject: Re: newbie question on indexed properties
|
>--------------------------------------------------------------------------------------------------------------|
You will need to add indexed getters and setters --
public String getAnswer(int index);
public String setAnswer(int index, String value);
<logic:iterate name="questionForm" property="answers"
id="answer" indexId="ctr">
<br/><html:text property=â<%="answer["+ctr+"]"%>â/>
</logic:iterate>
[EMAIL PROTECTED] wrote:
>
>
>
> I have a form bean with a string array defined as a property, with a
> corresponding set/get like this:
>
> private String[] answers = { "Answer 1","Answer 2","Answer 3","Answer
> 4","Answer 5" };
> public String[] getAnswers() { return (this.answers); }
> public void setAnswers(String[] value) { this.answers = value; }
>
>
> On my jsp I've coded the following iteration to display array 'answers'
and
> it works fine:
>
> <c:forEach var="row" items="${questionForm.answers}">
> <c:out value='${row}'/></br>
> </c:forEach>
>
>
> But rather than just display these rows, I'd like to write them as
> textareas that can be read back into the form-bean.
> I've read quite a few postings regarding this, but nothing I've seen and
> tried seems to work.
>
> Has anyone actually done this with any success?
>
>
> Regards,
> John
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]