8 Replies Latest reply on Apr 7, 2010 10:07 AM by rodmen

    rich:pickList

    rodmen

      Hi, I'm having problems using r:pickList when I do this way, works fine...

       

      <r:pickList id="clientesAgenciaPickList" style="text-align: left;" showButtonsLabel="false"
           value="#{pedidoBBean.clientesAgencia}" immediate="true">
           <f:selectItem itemLabel="Option 1" itemValue="1041"/>
           <f:selectItem itemLabel="Option 2" itemValue="413"/>
           <f:selectItem itemLabel="Option 3" itemValue="3"/>
           <f:selectItem itemLabel="Option 4" itemValue="4"/>
           <f:selectItem itemLabel="Option 5" itemValue="637"/>
           <f:selectItem itemLabel="Option 6" itemValue="555"/>
           <f:selectItem itemLabel="Option 7" itemValue="444"/>
           <f:selectItem itemLabel="Option 8" itemValue="333"/>
           <f:selectItem itemLabel="Option 9" itemValue="456"/>
           <f:selectItem itemLabel="Option 10" itemValue="56"/>
           <f:selectItem itemLabel="Option 11" itemValue="10411"/>
           <f:selectItem itemLabel="Option 12" itemValue="4131"/>
           <f:selectItem itemLabel="Option 13" itemValue="31"/>
           <f:selectItem itemLabel="Option 14" itemValue="41"/>
           <f:selectItem itemLabel="Option 15" itemValue="6371"/>
      </r:pickList>
      

       

       

      bien.JPG

       

      But when I’m using selectItems instead, displays only the left list and don’t pay attention to the values pre selected

       

       

       

      <r:pickList id="clientesAgenciaPickList" style="text-align: left;" showButtonsLabel="false"
           value="#{pedidoBBean.clientesAgencia}" immediate="true">
           <f:selectItems value="#{pedidoBBean.selectItemsClientesAgencia}"/>
      </r:pickList>
      

       

      mal.JPG

       

      pedidoBBean.clientesAgencia is :

       

       

      String x[] = {"1041", "413", "637"}; 
      this.setClientesAgencia(x);
      

       

      This ids ("1041", "413", "637") are into the pedidoBBean.selectItemsClientesAgencia to

       

       

      Any help would be appreciated

       

      Thank you

        • 1. Re: rich:pickList
          ilya_shaikovsky

          should works in latest 3.3.3 CR1 version. Fully the same case was checked during other thread investigation about two weeks ago

          • 2. Re: rich:pickList
            rodmen

            Thank you very much Ilya, I have replace the jars but is not working, what can I do?

             

            jars.JPG

            This is my code

             

            <r:pickList id="clientesAgenciaPickList" style="text-align: left;" showButtonsLabel="false" 
                 value="#{pedidoBBean.clientesAgencia}" immediate="true">
                 <f:selectItems value="#{pedidoBBean.selectItemsClientesAgencia}"/>
            </r:pickList>
            
            
            

             

            Thank you

            • 3. Re: rich:pickList
              ilya_shaikovsky

              could you please try to replace array of Strings with List<String>?

              • 4. Re: rich:pickList
                rodmen

                Hi Ilya I did try whit List<String>, now pedidoBBean.clientesAgencia is a List<String> but is not working yet...

                 

                I have found that if I do this

                 

                 

                <r:pickList id="clientesAgenciaPickList" style="text-align: left;" showButtonsLabel="false" 
                     value="#{pedidoBBean.clientesAgencia}" immediate="true">
                     <f:selectItems value="#{pedidoBBean.selectItemsClientesAgencia}"/>
                     <f:selectItem itemValue="413" itemLabel="CABLEVISION"/>
                </r:pickList>
                
                
                

                 

                 

                Displays the following...

                 

                prueba.bmp

                 

                but is not dynamic

                • 5. Re: rich:pickList
                  ilya_shaikovsky

                  I'm not sure now...

                   

                  that code works for me

                   

                  public class PickListBean {
                   
                  private List<String> result = new ArrayList<String>();
                   
                  public PickListBean() {
                  result.add("Denver");
                   
                  }
                  

                   

                  <rich:pickList value="#{pickListBean.result}"> 
                                 <f:selectItems value="#{capitalsBean.capitalsOptions}"/>
                                 <a4j:support event="onlistchanged" reRender="result"/>
                            </rich:pickList>
                   
                  

                  • 6. Re: rich:pickList
                    rodmen

                    What about the

                     <a4j:support event="onlistchanged" reRender="result"/>
                     
                    I'm sure that the pedidoBBean.clientesAgencia is populated I print it on screen

                    pruebaa.JPG

                    What would it be?
                    
                    
                    Thank you very much

                    • 7. Re: rich:pickList
                      ilya_shaikovsky

                      this support only used to update the result list when selection changed.

                       

                      B.t.w. I just get the code of richfaces-demo page (pickList sample) and just filled the list in bean with initial values with no other changes. You could download sources dfrom svn and check it also.

                      • 8. Re: rich:pickList
                        rodmen

                        Ok, thank you very much