11 Replies Latest reply on Dec 1, 2010 10:16 AM by dhikra86

    rich:listShuttle - targetValue list in the backing bean is not updated

    reyaron

      Hi

      Here is my code:

      <rich:listShuttle id="ls"
                                sourceValue="#{foo.myAvailableList}"
                                 targetValue="#{foo.myChozenList}"
                   var="items"
                   converter="myConverter">

                <rich:column>         
                       <h:outputText value="#{items.number}-#{items.name}"></h:outputText>
                   </rich:column>

      </rich:listShuttle>

       

      My backing bean uses ArrayList for both lists.

       

      I am using:

      richfaces version: 3.3.2.SR1, jboss 6

       

      Thanks

      Yaron

        • 1. Re: rich:listShuttle - targetValue list in the backing bean is not updated
          nbelaevski

          Hi Yaron,

           

          Please add rich:messages component and check if some messages were generated by JSF.

          • 2. Re: rich:listShuttle - targetValue list in the backing bean is not updated
            reyaron

            Hi Nick,

            Yes, I added: <rich:message for="ls"/>, there is no message.

            My client component moves the selected component from one side to another.

            The problem is that my selectedItems ArrayList, in my backing bean remains empty.

            I can see that the debugging breakpoint on this list setter, pass empty list as argument to the setter instead of list with my selected items.

            I don't understand how come the component shows that the item is selected fine, while my backing bean lists don't change.

            BTW, I tried to do that with Lists that hold Strings and it acts the same.

             

            here is my backing bean code for the String Lists example:

                ArrayList<String> aFoo = new ArrayList<String>();

                ArrayList<String> cFoo = new ArrayList<String>();
                public ArrayList<String> getaFoo() {        return aFoo;    }
                public void setaFoo(ArrayList<String> aFoo) {    this.aFoo = aFoo;    }
                public ArrayList<String> getcFoo() {        return cFoo;    }
                public void setcFoo(ArrayList<String> cFoo) {        this.cFoo = cFoo;    }

            • 3. Re: rich:listShuttle - targetValue list in the backing bean is not updated
              reyaron

              You won't believe that!

              I changed my Jboss version from jboss-6.0.0.M1 to jboss-5.1.0.GA and it worked.

              jboss-6.0.0.M1 does not support listShuttle!

              • 4. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                nbelaevski

                Hi Yaron,

                 

                JBoss 6 comes with JSF 2.0, so you should be using JSF2-version of RichFaces 3.3.3.CR1.

                • 5. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                  reyaron

                  Hi Nick,

                  I don't won't to use JSF 2 in my application yet because I tried it and there is a big lack in Rich Faces support of its AJAX components (Only very basic components are supported and it seems to me that the JSF 2 certification is the only reason that RF came out with this version).

                  I specifically mentioned in my pom.xml that I am using JSF 1.2 version and it workes fine in all other components I use except the listSuttle.

                  I think that its a bug in RF.

                  • 6. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                    nbelaevski

                    Ok, then either:

                     

                    1) Make sure you are using JSF 1.2, not 2.0 version

                    or

                    2) Upgrade to 3.3.3.CR1 for JSF2

                    • 7. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                      reyaron

                      Hi,

                      about option 1:

                      "1) Make sure you are using JSF 1.2, not 2.0 version"

                      It seems that I didn't use JSF 1.2 because it was in "provided" scope in my pom.xml:

                                  <dependency>
                                      <groupId>javax.faces</groupId>
                                      <artifactId>jsf-api</artifactId>
                                      <version>1.2_13</version>
                                      <scope>provided</scope>
                                  </dependency>
                                 
                                  <dependency>
                                        <groupId>javax.faces</groupId>
                                        <artifactId>jsf-impl</artifactId>
                                        <version>1.2_13</version>
                                        <scope>provided</scope>
                                  </dependency>

                      Removing the scope requires also to add the ear file libs the: jboss-faces.jar under JBOSS_HOME/server/default/deploy/jbossweb.sar/jsf-libs

                      or to replace the JSF jars in this directory.

                      This option didn't help me because it causes exceptions with my Seam jars (version 2.1.2) during the deployment.

                       

                      about option 2:

                      "2) Upgrade to 3.3.3.CR1 for JSF2"

                      I saw the limitation of this version and I can live with that.

                      This option helped me and it works.

                      Thanks a lot!

                      Yaron

                      • 8. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                        tomvdv

                        Hi Everyone,

                         

                        I had the same problem: The sourceValue and targetValue weren't updated in the bean when I was submitting the form.

                        I could fix it by setting immediate="true"  ( eg: <rich:listShuttle ... immediate="true" /> ).

                        I suppose this tag skip some actions which caused the problem.

                         

                        Thomas.

                        • 9. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                          ilya_shaikovsky

                          let's start from the beginning. add rich:messages to the page and remove immediate. then you should be able to see messages about conversion/validation problems if exist.

                          • 10. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                            tomvdv

                            I tried that before and there was no error displayed.

                            Anyway it is not a problem due to my converter/validator because a simple List<String> gives me the same error (if I don't put "immediate"): The setter is always called with a null value.

                            I think there are just some issue with this rich component in my system environment (using Seam+Trinidad).

                            Nevermind, the "immediate=true" fixes it

                            • 11. Re: rich:listShuttle - targetValue list in the backing bean is not updated
                              dhikra86

                              I have the same problem. I use JSF1.2 and Richfaces 3.3.2 SR1.

                              TargetValue is not backing in the bean.

                              I tested whith picklist and it works but I used shuttlist and don't went to change now.

                              It s a problem of version?

                              Please help, thank you