This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Get the modified value from ArrayList of HashMap. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Get the modified value from ArrayList of HashMap." Watch "Get the modified value from ArrayList of HashMap." New topic
Author

Get the modified value from ArrayList of HashMap.

Lan Ama
Greenhorn

Joined: Jun 10, 2009
Posts: 1
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 (i replace "<>" with "[]")
===
[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] [OneTwo]
[TwoOne] [TwoTwo]

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

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

Please advise. Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get the modified value from ArrayList of HashMap.
 
Similar Threads
"The path of an ForwardConfig cannot be null" error in Second run
Nested Iterator Tags
Accessing elements from an arraylist
INDEX PROPERTY <html:form> with nested beans
Iterator in Struts 1