title: PrimeFaces PickList : source and target lists not updated
body: <p>I am setting up a primefaces picklist and the source and target lists stay empty.</p>
  
  <p>page.xhtml</p>
  
  <pre><code>&lt;h:form&gt;
      &lt;p:pickList id="picklist" value="#{bean.users}" var="user" 
          itemValue="#{user}" itemLabel="#{user.login}" converter="userConverter"&gt;  
  
      &lt;f:facet name="sourceCaption"&gt;Source&lt;/f:facet&gt;  
      &lt;f:facet name="targetCaption"&gt;Target&lt;/f:facet&gt;  
  
      &lt;p:ajax event="transfer" listener="#{bean.onTransfer}" /&gt;    
  
      &lt;p:column style="width:75%;"&gt;  
          &lt;h:outputText value="#{user.login}" /&gt;  
      &lt;/p:column&gt;  
  
      &lt;/p:pickList&gt;
  
      &lt;h:commandButton id="submit" type="submit" actionListener="#{bean.submit}" value="Submit" /&gt;
      &lt;h:commandButton id="display" actionListener="#{bean.displayTargetList}" value="Display Target List" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>bean.java</p>
  
  <pre><code>@ManagedBean(name = "bean")
  @ViewScoped
  public class Bean {
  
      private List&lt;User&gt; source;
      private List&lt;User&gt; target;
      private DualListModel&lt;User&gt; users;
  
      public void setTarget(List&lt;User&gt; list) {
          this.target = list;
      }
  
      public void setSource(List&lt;User&gt; list) {
          this.source = list;
      }
  
      public void setUsers(DualListModel&lt;User&gt; list) {
          this.users = list;
      }
  
      public DualListModel&lt;User&gt; getUsers() {
          return this.users;
      }
  
      public List&lt;User&gt; getSource() {
          return this.source;
      }
  
      public List&lt;User&gt; getTarget() {
          return this.target;
      }
  
      @PostConstruct
      public void init() {
          this.source = myController.getUsers(); // return all my users in database
          this.target = new ArrayList&lt;User&gt;();
          this.users = new DualListModel&lt;User&gt;(this.source, this.target);
      }
  
      public void submit() {
  
      }
  
      public void displayTargetList() {
          System.out.println("Entering function");
          Iterator&lt;User&gt; iterator = this.target.iterator();
          while(iterator.hasNext()) {
              User u = iterator.next();
              System.out.println(u.getLogin());
          }
      }
  
  }
  </code></pre>
  
  <p>And there is the converter</p>
  
  <p>userConverter.java</p>
  
  <pre><code>@FacesConverter("userConverter")
  public class UserConverter implements Converter{
  
      private List&lt;User&gt; users;
  
      public UserConverter(){
          this.users = MyController.getAllUsers();
      }
  
      public Object getAsObject(FacesContext context, UIComponent component, String value) {
          return this.getUserById(value);
      }
  
      public String getAsString(FacesContext context, UIComponent component, Object value) {
          return ((User) value).getId();
      }
  
      public User getUserById(String id) {
          // return the user searching from this.users
      }
  }
  </code></pre>
  
  <p>The code I have is a little more complex but I hope the mistake is here. For me it seems to be implemented like the primefaces showcase. I could add that the method getAsObject in the converter return an object (I tried to print before returning the value and the objects wasn't null)</p>
  
  <p>If you can help.
  Thanks</p>