I have a HashMap with String keys and List values:
Is there a way to bind text fields to the strings in the list?Code:List l1 = new ArrayList(); List l2 = new ArrayList(); List l3 = new ArrayList(); l1.add(""); l1.add(""); l2.add(""); l2.add(""); l3.add(""); l3.add(""); Map map = new HashMap(); map.put("key1",l1); map.put("key2",l2); map.put("key3",l3);
I would imagine that would be the mapping but it does not work. map[key1] works for a hashmap and list[0] works for a list but is there a way to combine? Do I need to write some custom binders to get this to work?Code:<input type="textfield" name="map[key1][0]" value="value"/> <input type="textfield" name="map[key1][1]" value="value"/> <input type="textfield" name="map[key2][0]" value="value"/> <input type="textfield" name="map[key2][1]" value="value"/> <input type="textfield" name="map[key3][0]" value="value"/> <input type="textfield" name="map[key3][1]" value="value"/>
Thanks,
Ethan Schreiber


Reply With Quote