Get the modified value from a list of HashMap

Joined
Jun 10, 2009
Messages
1
Reaction score
0
I am displaying an ArrayList of HashMap in JSP using logic:iterate.

action form (MyForm)
===========
private ArrayList myList = new ArrayList();

public ArrayList getMyList() {
return myList;
}
public void setMyList(ArrayList myList) {
this.myList = myList;
}

initial action
==============
ArrayList list = new ArrayList()
Map map = new HashMap()
map.put("ONE","OneOne")
map.put("TWO","OneTwo")
list.add(map);
map = new HashMap()
map.put("ONE","TwoOne")
map.put("TWO","TwoTwo")
list.add(map);
myForm.setMyList(list)

JSP
===
<table>
<logic:iterate id="myList" name="MyForm" property="myList" indexId="index">
<tr>
<td>
<html:text name="myList" property="ONE" indexed="true" />
</td>
<td>
<html:text name="myList" property="TWO" indexed="true" />
</td>
</tr>
</logic:iterate>
</table>


The display is OK as it shows all the contents of the list.

[OneOne] [TwoOne]
[OneTwo] [TwoTwo]

My problem is that if i modify the contents... for example i modified it as:
[A]
[C] [D]

then click a submit button, the changes are not reflected in the Action.

Please advise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top