Tuesday, October 11, 2005

Struts and Indexed Properties



Check those links in case you have an indexed property (like an array or list). It is very useful when you have a table that you want struts to link their properties automatically to the form.

In my case, it is a list (java.util.List) of item beans in the form that is iterated in the JSP, like this:

<logic:iterate id="items" name="orderEditForm" property="items">

<html:text name="items" indexed="true" property="product"/>
<html:text name="items" indexed="true" property="quantity"/>
<html:text name="items" indexed="true" property="amount"'/>


This "items" property is defined in the orderEditForm as a List. Note the "indexed" property of html:text element.
Post a Comment