<form-bean name="productForm"> <form-property name="product" type="java.util.ArrayList" />
..
<action name="productForm" path="/products" scope="session"... ...
DynaActionForm theForm = (DynaActionForm) form;
ArrayList productList = ....
theForm.set("product",productList);
//and for some stange reason.. try without the following first
session.setAttribute("product",productList);
...
<logic:iterate id="product" name="productForm" property="product"> <html:text name="product" property="price" />
... DynaActionForm theForm = (DynaActionForm) form; ArrayList productList = (ArrayList) theForm.get("product");
for(int i = 0;i < productList.size();i++) { Product prod = (Product) productList.get(i); System.out.println( prod.getPrice() ); }
...
This should help.. Cheers Mark
On Tuesday, October 7, 2003, at 08:48 PM, Cornellious Mann wrote:
I am wondering what is the best approach to handle dynamic form fields within an ActionForm.
I have a JSP page that will display quantity input fields for a dynamic list of products. I don't know how many products will be in the list until runtime.
How can I set up my ActionForm to handle the list in input parameters?
Thanks for any help.
===== Best Regards, Cornellious Mann
__________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com
--------------------------------------------------------------------- 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]