You can create indexed properties (   getOrderDetail(int),
setOrderDetail(int, string)  )
You have to back them whatever way you see fit (I've used arrays in the past
but I had to make sure they were sized propertly on each call).  On your
JSP, the resulting names for your input fields will need to be indexed:
<html:text name="orderDetail" property="quantityShipped[${index}]"/> will
work if you are using the EL version of the html taglib. (Although I'm not
sure the name property has to be specified if you use the html:form tag
instead of the form tag as you've shown here)




-----Original Message-----
From: MarwanSalam <[EMAIL PROTECTED]> [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 10, 2003 5:46 PM
To: [EMAIL PROTECTED]
Subject: posting an updated collection back to Action


Hi,

I have a list of line items displayed in a JSP where some of the
attributes can be edited. I would like to capture the updated data by
the user to return it to my Action class so I can modify my model
accordingly.

Here is my JSP code:

<form action="updateOrder.do" method="post">
  <input type="hidden" name="action" value="updateOrder">
  <logic:iterate id="orderDetail" type="OrderDetailModel"
                 collection="<%= orderDetailList %>">
   <td><html:text name="orderDetail" property="quantityShipped"/></td>
  </logic:iterate>
  <input type="submit" value"Update Order">
</form>

I know my ActionForm class has to have a property called
orderDetailList. But the question is, how will the correct index be
updated since my list can contain many OrderDetailModel's? Should I
add a method in my ActionForm class like getOrderDetailList.get
(index)? Help!!!


---------------------------------------------------------------------
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]

Reply via email to