You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thomas Hsieh <ho...@yahoo.com> on 2001/06/04 17:33:12 UTC

Generating Dynamic Input Tables.`

I hope this isn't a repeat, but I need a bit of help here.

I have a collection of simple value beans that I'd like to
allow the user to edit.  I don't know how large the
collection is, but the simple bean merely contains a Label
and Value.

I'm trying to do something like the jsp code below. If
there is a simpler way to deal with this I'm open to it as
well.

Thanks in advance!!

Thomas



collBean = The bean containing the collection.
collProp = The property name of the collection in collBean.


<table>

  <tr>
    <logic:iterate id="aBean" name="collBean"
property="collProp">
    <td><bean:write name="aBean" property="label"/></td>
  </tr>

  <tr>
    <logic:iterate id="aBean" name="collBean"
property="collProp">
      <td>
        <html:text property="<%= aBean.getLabel() %>"
value="<%= aBean.getValue() %>" />
      </td>
    </logic:iterate>
  </tr>

</table>

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/