1 Reply Latest reply on Jan 21, 2010 6:16 AM by Ilya Shaikovsky

    PickList - no selected items for own objects

    Oliver G. Newbie

      [Edit: Solved by correct implementation of hashCode() and equals(), thanks.]

       

      Hello,

       

      I got a problem with pickLists since RichFaces 3.3.x:

       

       

      <rich:pickList id="userPickList" value="#{bean.selectedUsers}" showButtonsLabel="false"
           converter="#{bean.userConverter}" sourceListWidth="179px" targetListWidth="179px">
         <f:selectItems value="#{bean.userSelectItems}"/>
      </rich:pickList>

       

       

      In the left list all items are displayed normally, but no selected items are displayed in the right list, although value/selectedUsers is filled.

       

      If I use items of type String (without converter), pickList works perfect. But for own user objects in combination with converter it doesn't work. User objects  (simple POJOs) are something like this:

       

       

      public class User extends DefaultDomainObject<Long> {
        private String firstName;
        private String lastName;
        //...
        public String toString() {return loginName;}
        //...

      }

       

       

      The userConverter implements javax.faces.convert.Converter as usual.

       

      This code and the pickList works very well on RichFaces 3.2.x (tested with 3.2.2.GA).

      The problem occured since I switched to 3.3.2.GA (also on 3.3.2.SR1 and 3.3.3.BETA1).

      (Tested with Tomcat 6.0.20, JRE 1.6.0_11, MyFaces 1.2.3, ...)

       

      Thank you very much for your help!