Results 1 to 2 of 2

Thread: Binding Map with values that contains Lists.

  1. #1
    Join Date
    Dec 2004
    Posts
    9

    Default Binding Map with values that contains Lists.

    I have a HashMap with String keys and List values:

    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);
    Is there a way to bind text fields to the strings in the list?

    Code:
    <input type="textfield" name="map&#91;key1&#93;&#91;0&#93;" value="value"/>
    <input type="textfield" name="map&#91;key1&#93;&#91;1&#93;" value="value"/>
    
    <input type="textfield" name="map&#91;key2&#93;&#91;0&#93;" value="value"/>
    <input type="textfield" name="map&#91;key2&#93;&#91;1&#93;" value="value"/>
    
    <input type="textfield" name="map&#91;key3&#93;&#91;0&#93;" value="value"/>
    <input type="textfield" name="map&#91;key3&#93;&#91;1&#93;" value="value"/>
    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?

    Thanks,

    Ethan Schreiber

  2. #2
    Join Date
    Dec 2004
    Posts
    9

    Default funny how it works

    I was stuck on this for a few hours yesterday. I posted the question this morning and I figured it out as soon as I finished posting:

    I had both the spring-1.1.1 and spring-1.1.4 jars in my lib dir cause I didn't do a clean build. I deleted the spring-1.1.1.jar and it started working! Apparently, this functionality is supported by spring-1.1.4 but not 1.1.1

    Ethan

Similar Threads

  1. MySQL DDL
    By analogueboy in forum Security
    Replies: 5
    Last Post: Aug 17th, 2007, 03:48 PM
  2. Binding to Dynamic Lists
    By lindbird in forum Web
    Replies: 4
    Last Post: Sep 30th, 2005, 08:46 AM
  3. Replies: 2
    Last Post: May 5th, 2005, 09:35 PM
  4. 3rd party integration for Glazed Lists
    By swankjesse in forum Swing
    Replies: 12
    Last Post: Nov 25th, 2004, 01:44 PM
  5. Replies: 2
    Last Post: Aug 17th, 2004, 04:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •