4 Replies Latest reply on Oct 12, 2009 5:26 AM by ilya_shaikovsky

    problem with picklist

    cremersstijn

      I've got a problem with the picklist.

      I want to set the selected values of the picklist with anohter action then the default ons (add all, add, remove, remove all).

      This is what i do: when i click on a button i fill up the selected items (selectedCarrierHubs) of the picklist and after this i rerender the picklist. But only the last one is moved to the right box, but all items are removed from the left box. When i try to remove the item from the right box, it won't go away.

      the .xhtml of the picklist

      <rich:pickList id="hubs" value="#{cartonLogReportBean.selectedCarrierHubs}">
       <f:selectItems value="#{cartonLogReportBean.carrierHubs}" />
       <a4j:support event="onlistchanged" reRender="hubs, hubResult" action="#{cartonLogReportBean.updateHubSelectionListAndTest}" />
      </rich:pickList>
      


      the code to set the selected items:

      public void setCarrierHubsCustomList(final CustomListSelection selection) {
       selectedCarrierHubs = new ArrayList<Integer>();
       for (CustomSelectItem sel : selection.getItemsInList()) {
       selectedCarrierHubs.add(Integer.parseInt(sel.getValue()));
       }
      }