3 Replies Latest reply on Oct 6, 2008 11:58 AM by nimo stephan

    rich:pickList value in Map?

    nimo stephan Master

      Hello,

      I have a pickList which works correctly
      and saves the itemValue "hello" in my ArrayList:

      <rich:pickList value="#{myBean.selectedValues}">
      <f:selectItem itemValue="hello" itemLabel="hello"/>
      </rich:pickList>
      
      //selectedValue is a ArrayList:
      
      private List<String> selectedValues;
      // getter/setter


      But now, I want to store the selected Value in a Map:

      <rich:pickList value="#{myBean.selectedValues[key]}">
      <f:selectItem itemValue="hello" itemLabel="hello"/>
      </rich:pickList>
      
      //selectedValue is a Map:
      
      private Map<String, String> selectedValues;
      // getter/setter


      But the pickList stores anything false:

      Instead of having this in my Map:

      {key="hello"}

      the pickList returns this:

      {key=[Ljava.lang.String;@a54263}

      What is wrong? I have also tried it with this without success:
      private Map<String, SelectItem> selectedValues;


      Can anybody tell what I made wrong ?