8 Replies Latest reply on Jan 30, 2009 11:11 AM by archana rao

    ListShuttle Problem

    archana rao Newbie

      Hi,

      I am using richfaces-ui-3.3.0.GA library. I am trying to use a ListShuttle component. I am displaying List of objects in my sourcelist and target list. ListShuttle object is properly displaying list of items in my source list and target list. I also have defined commandButton. When I click the commandButton jsf is throwing the following error "sourceId=modifyqueueform:hostNameListId[severity=(ERROR 2), summary=("Component modifyqueueform:hostNameListId has invalid value expression Test1"), detail=("Component modifyqueueform:hostNameListId has invalid value expression Test1")]" and is not entering the commandButton's action method. I also have defined my own converter object. I don't know how to fix this problem. I really appreciate your help on this subject.

        • 1. Re: ListShuttle Problem
          Nick Belaevski Master

          Hi,

          What does "Test1" stand for? Please post full page code.

          • 2. Re: ListShuttle Problem
            archana rao Newbie

            Right now I am getting this message "Property not writable on type java.util.List javax.el.PropertyNotFoundException:"

            Here is part of my xhtml page where I have defined Listshuttle


            <rich:listShuttle id="hostNameListId"
            binding="#{ExampleList.hostNameShuttleList}"
            converter="#{ExampleList.convert}"
            sourceValue="#{ExampleList..sourceHostNameList}"
            targetValue="#{ExampleList..targetHostNameList}"
            var="items">
            <rich:column>
            <h:outputText value="#{items.hostName}"></h:outputText>
            </rich:column>
            </rich:listShuttle>
            <a4j:commandButton value="OK"
            reRender="modifyqueueform"
            binding="#{ExampleList.okButton}"
            action="#{ExampleList.reModifyHostNameList}">
            </a4j:commandButton>


            where sourceHostNameList and targetHostNameList are list of HostName object.

            class HostName {

            private String hostName;

            }

            In the ExampleList bean's construcor I am Instantiating HostName object with Test1 as host name and adding it to sourcelist. In the same way I am creating one more HostName object with Test2 as host name and adding it to the targetlist.

            list is coming up with the proper host names in the source and target list box. when I click the ok button thats when it throws the exception

            • 3. Re: ListShuttle Problem
              archana rao Newbie

              Sorry for the previous post. I forgot to mark the code with code tags.

              Right now I am getting this message "Property not writable on type java.util.List javax.el.PropertyNotFoundException:"

              Here is part of my xhtml page where I have defined Listshuttle

              <td align="left">
              <rich:listShuttle id="hostNameListId"
               binding="#{ExampleList.hostNameShuttleList}"
               converter="#{ExampleList.convert}"
               sourceValue="#{ExampleList..sourceHostNameList}"
               targetValue="#{ExampleList..targetHostNameList}"
               var="items">
               <rich:column>
               <h:outputText value="#{items.hostName}"></h:outputText>
               </rich:column>
              </rich:listShuttle>
              <a4j:commandButton value="OK"
               reRender="modifyqueueform"
               binding="#{ExampleList.okButton}"
               action="#{ExampleList.reModifyHostNameList}">
              </a4j:commandButton>
              </td>
              
              where sourceHostNameList and targetHostNameList are list of HostName object.
              
              class HostName {
              
               private String hostName;
              
              }
              In the ExampleList bean's construcor I am Instantiating HostName object with Test1 as host name and adding it to sourcelist. In the same way I am creating one more HostName object with Test2 as host name and adding it to the targetlist.

              list is coming up with the proper host names in the source and target list box. when I click the ok button thats when it throws the exception

              • 4. Re: ListShuttle Problem
                Nick Belaevski Master

                I see there are two dots here:

                #{ExampleList..sourceHostNameList}, #{ExampleList..targetHostNameList}
                Can this be the reason?

                • 5. Re: ListShuttle Problem
                  Ilya Shaikovsky Master

                  also except the converter you should override equals and hasCode inside your objects properly

                  • 6. Re: ListShuttle Problem
                    archana rao Newbie

                    Hi,

                    Thank you for your response. The two dots in the code was a copy and paste problem. I have correctly written in my code. I have also overridden eqals and hasCode methods for HostName object. The problem I am currently facing is when I click ok button before it comes to the action method it is throwing the following exception.
                    sourceId=modifyqueueform:hostNameListId[severity=(ERROR 2), summary=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 sourceValue="#{ExampleList.sourceHostNameList}": Property 'sourceHostNameList' not writable on type java.util.List), detail=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 sourceValue="#{PitcherQueues.sourceHostNameList}": Property 'sourceHostNameList' not writable on type java.util.List)]

                    sourceId=modifyqueueform:hostNameListId[severity=(ERROR 2), summary=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 targetValue="#{ExampleList.targetHostNameList}": Property 'targetHostNameList' not writable on type java.util.List), detail=(javax.el.PropertyNotFoundException: /pages/ExampleList.xhtml @289,18 targetValue="#{ExampleList.targetHostNameList}": Property 'targetHostNameList' not writable on type java.util.List)]

                    • 7. Re: ListShuttle Problem
                      Ilya Shaikovsky Master

                      show java code also then.

                      • 8. Re: ListShuttle Problem
                        archana rao Newbie

                        Hi,

                        My code is working. The problem was in my bean object. In the methods sourceHostNameList() and targetHostNameList() instead of passing List object i was passing ArrayList object.