<input type="text" name="items[0].code" value="ABC" /> <input type="text" name="items[1].code" value="BCD" />
Paul Barry wrote:
If I do this:
<c:forEach var="item" varStatus="loop" items="${items}"> <html:text property="items[${loop.index}].code"/> </c:forEach>
It gives me the results I want:
<input type="text" name="interests[0].code" value="ABC" /> <input type="text" name="interests[1].code" value="BCD" /> ...
But I can't get indexed="true" to work with c:forEach
Paul Barry wrote:
Yeah, if I remove the indexed="true", my JSP code looks like this:
<c:forEach var="item" items="${items}"> <html:text name="item" property="code"/> </c:forEach>
I get a bunch of HTML inputs like this:
<input type="text" name="code" value="ABC" />
With different values but all named code. Code is a property of item, and each item in items has a different code.
Niall Pemberton wrote:
What happens if you remove the "indexed" attribute from all the
<html:text> - does it work properly then (except for the "name" attribute)
is the html page generated OK?
Niall
----- Original Message ----- From: "Paul Barry" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 05, 2004 9:49 PM Subject: indexed="true" is only valid within an enclosing iterate tag
I am trying to use indexed properties in a form, as described in James Turner's Article "Succeeding With Struts: Indexed Properties and Beans as Properties" at http://www.developer.com/java/ejb/article.php/2233591
The example shows you can use c:forEach with <html:text indexed="true"/>, like this:
<c:forEach var="lines" items="${purchaseOrderBeanForm.map.lines}" >
<TR><TD><html:text indexed="true" name="lines"
property="partNumber"/></TD>
<TD><html:text indexed="true" name="lines" property="quantity"/></TD>
<TD><html:text indexed="true" name="lines" property="price"/></TD></TR>
</c:forEach>
But when I try to do that, I get this error:
indexed="true" is only valid within an enclosing iterate tag
Is my code wrong or is the example wrong?
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]