In Struts, how do I do nested iterated form fields?
843836Jan 28 2005 — edited Mar 4 2005After a lot of wasted time I have succeeded in getting nested iterated form fields working. But, I only succeeded by cheating a bit. My final solution to output a text input field is:
<nested:form action="/list/view/EditCustomViewSubmit" method="post">
<nested:iterate property="customViewCellBeans" id="customViewCellBean" indexId="beanCellIx"> <nested:root name="customViewCellBean">
<nested:iterate property="customViewCellParams" id="customViewCellParam" offset="1" indexId="paramIx">
<INPUT type=text name="customViewCellBean[<%=beanCellIx%>].customViewCellParam[<%=paramIx%>].param" value="<nested:write property="param"/>">
It's all good except for the place where I actually output the text field. I have to hardcode html with taglets there instead of using a nested:text tag. I wouldn't have a problem with this except that this solution means that I can't use the optionsCollection stuff to output dropdown lists.
Basically, I want to know how to convert that last INPUT tag to use a nested:text tag.