Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using Arraylist in jsp with values in combo-box

Status
Not open for further replies.

enginblack

Programmer
Jun 10, 2006
2
IT
Hi people,
Please help me...
I'm a struts beginner developer, I'm trying to pass an arraylist of objects in a jsp using the session.
In the jsp I see the list of the objects correctly, and I need to change the value of one of the fields,for each of the objects, using a combo-box.
The combo-box contains a "<options collection.../>" that is ok.
But when I set the value for each element of the list and I click on the sumbit, in the execute() of the action I recieve the list in the session with non value set.
Here the code in the jsp:

.....
<logic:notEmpty name="contacts">
<logic:iterate name="contacts" id="one" indexId="numRiga" >
<tr><td colspan="3">
CONTACTS:<BR>
Number: <bean:write name="one" property = "number"/>&nbsp;&nbsp;-&nbsp;&nbsp;<bean:write name="one" property = "year"/>
Date: <bean:write name="one" property = "date"/>&nbsp;&nbsp;&nbsp;<br>
Name: <bean:write name="one" property = "name"/>&nbsp;&nbsp;&nbsp;<br>
Country:<html:select name="one" property = "country">
<html:eek:ptions collection="countries" property="code" labelProperty="countryName" />
</html:select>
</td></tr>
</logic:iterate>
</logic:notEmpty>
......

Why doesn't it works ???
Many thanks
 
This is a little old, so you may have found the answer to your question. However, just in case you haven't, you might want to check the id attribute of your logic:iterate tag. The id should match an indexed getter and setter method in you formbean and then each of your editable fields should have the indexed attribute set to true. If you're still looking for help, let me know and I can go into more detail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top