2 Replies Latest reply on Jul 7, 2010 4:12 AM by praktimarc

    Problem with picklist - strange setter calling...

    praktimarc

      Hello there,

       

      Introducion:

      I try to use a rich:picklist for choosing some selectitems.

      I use Richfaces-ui-3.3.2.SR1, Tomcat 6.026.

       

       

      Problem:

      The left (source-list) side of the picklist I give some SelectItems, wich are shown normally.

      If i click to these entrys they appear on the right side and disappear on the left side.

       

      So long...fine - but the setter didnt work correctly - its simply not called except I copy the last element from the right list to the left.

       

      Strange, very strange - I has read about a bug of the component, so is there any workaround wich will make the usage of the picklist possible?

       

      If the usage of the picklist may is not possible I can use a shuttle instead of this - but can anyone shortly say me what type the source have to be? I tried selectitems but this doesent work.

       

       

      Last but not least a little bit code:

       

      The Picklist in jsp file (picklist is placed in a data grid):

      [quote]

       

      <rich:pickList id="createUserNasAllowedShuttle"
                                              value="#{OverviewBean.test}">
                                              <f:selectItems value="#{OverviewBean.nasArray}" />
                                              <a4j:support event="onlistchanged"
                                                  process="createUserNasAllowedShuttle" ajaxSingle="true"
                                                  reRender="createUserValidationTable">
                                              </a4j:support>
                                          </rich:pickList>
      

      [/quote]

       

       

       

      The source List in Backing bean:

      [quote]

       

      nasArray = new SelectItem[nasListe.size()];
      
                   for (int i = 0; !nasListe.isEmpty(); i++) {
      
                  nasArray[i] = new SelectItem(nasListe.getFirst().getId(), nasListe
                          .getFirst().getStreet()
                          + " " + nasListe.getFirst().getStreet_no());
      
                  nasListe.removeFirst();
      }
      

       

      [/qoute]

       

       

       

       

      The target List in backing bean:

      [quote]

       

      /*****************************************************************
           * Test-target for the selectitems with test outline (for never will be executed becouse the target list is
           * empty in the one event if the setter will be called (right side of list will be empty...))
           */
          
          
          List<SelectItem> test = new ArrayList<SelectItem>();
          
          public List<SelectItem> getTest() {
              return test;
          }
      
          public void setTest(List<SelectItem> test) {
              System.out.println("OVB: setter entered");
              this.test = test;
              for (int i = 0; i<test.size(); i++) {
                  System.out.println("Listeninhalt bei " + i + " = " + test.get(i));
              }
          }
      

      [/quote]

       

       

      Tanks for reading!

       

      Greets,

       

      --Marc