This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes ArrayList is not populating in my form bean. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ArrayList is not populating in my form bean." Watch "ArrayList is not populating in my form bean." New topic
Author

ArrayList is not populating in my form bean.

Sarjith Pullithodi
Greenhorn

Joined: Oct 14, 2012
Posts: 1

Hi all,

My ActionForm has the following field.

//form
private ArrayList<String> chargeIds = new ArrayList<String>();
public ArrayList<String> getChargeIds() {
return chargeIds;
}
public void setChargeIds(ArrayList<String> chargeIds) {
this.chargeIds = chargeIds;
}//form

And in my jsp I wrote like below:-

//jsp
....
<html:form action="/PurchaseOrderAction" styleId="defaultForm">
<table>
<logic:iterate id="element" name="<%= Constants.SHOPPING_ORDER_CART_ITEMS %>" type="mypackage.ItemBean" >
<tr><td>
<logic:Equal name="element" property="promotedItem" value="true">
<html:select property="chargeIds" styleClass="transperentList" indexed="true">
<htmlptions collection="<%=Constants.ALL_CHARGES %>" property="key" labelProperty="name" />
</html:select>
</logic:Equal>
<logic:notEqual name="element" property="promotedItem" value="true">
<bean:write name="element" property="chargeName"/>
</logic:notEqual>
</tr></td>
.....
//jsp


I am getting jsp populated properly... but when i Submit the form.. i am not getting any value in the arraylist of my formbean.

any idea how? I am using struts 1.3 (unfortunately not able to update, as the project started from very long back, and i am a new member of the team).

Thanks.
--
Sarjith
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ArrayList is not populating in my form bean.