| Author |
Advance Java Indexed
|
Vijay Aneraye
Greenhorn
Joined: Sep 03, 2008
Posts: 8
|
|
Hello All, I have my jsp with indexed of checked box, <logic:iterate id="productVO" name="subscriptionForm" property="productsList"> <html:checkbox property="productId" name="productVO" ></html:checkbox> </logic:iterate> This is my Form Bean. public class SubscriptionForm extends ActionForm { private ProductsType[] productsList; /** * @return Returns the productsList. */ public ProductsType[] getProductsList() { return productsList; } /** * @param productsList The productsList to set. */ public void setProductsList(ProductsType[] productsList) { this.productsList = productsList; } } And this is public class ProductsType { private int productId; /** * @return Returns the productId. */ public int getProductId() { return productId; } /** * @param productId The productId to set. */ public void setProductId(int productId) { this.productId = productId; } } After submitting the form I want the all the selected productIds in to action, so I have written the core in Action of submit ProductsType[] productType=subscriptionForm.getProductsList(); if(productType!=null){ for(int i=0;i<productType.length;i++){ ProductsType proType=productType[i]; System.out.println(proType.isSelected()); } } SO every time I am getting null value for productType, is someting wrong ? Please Help me. Thanks Vijay
|
 |
Tom Rispoli
Ranch Hand
Joined: Aug 29, 2008
Posts: 349
|
|
|
In your html source, what the names that are generated for the checkbox fields? I think you need to use nested:iterate and nested:checkbox.
|
 |
 |
|
|
subject: Advance Java Indexed
|
|
|