3 Replies Latest reply on Jul 29, 2008 2:13 AM by David Gilks

    listShuttle interoperability

    David Gilks Newbie

      hi,
      Is it possible to have 2 listShuttle components interoperating on the same page ?

      I'm using 2 listShuttle's (say A and B) on a page that use the same sourceValue and different targetValues.
      When an item is moved from the source to the target for listShuttle A, i need that item to also be removed from the source for listShuttle B.

      Any ideas how to do this ? I've included my usage of the components below. I'm using RichFaces 3.1.6

      <rich:listShuttle id="groupingListShuttle" sourceValue="#{Controller.sourceShuttleList}" targetValue="#{TestFilterBean.groupingList}"
       var="item" sourceCaptionLabel="Data available for grouping" targetCaptionLabel="Group data by"
      sourceListWidth="150" targetListWidth="150"
       showButtonLabels="false" fastMoveControlsVisible="false" listsHeight="250" converter="TestFieldConverter">
       <rich:column>
       <h:outputText value="#{item.description}" />
       </rich:column>
      </rich:listShuttle>
      
      <rich:listShuttle id="displayListShuttle" sourceValue="#{Controller.sourceShuttleList}" targetValue="#{TestFilterBean.displayList}"
       var="item" sourceCaptionLabel="Data available for column display" targetCaptionLabel="Data column to display"
       sourceListWidth="150" targetListWidth="150"
       showButtonLabels="false" fastMoveControlsVisible="false" listsHeight="250" converter="TestFieldConverter">
       <rich:column>
       <h:outputText value="#{item.description}" />
       </rich:column>
      </rich:listShuttle>


        • 1. Re: listShuttle interoperability
          Ilya Shaikovsky Master

          add a4j:support to each shuttle. event should be onlist cahnged reRender should be pointed to the second list.

          So every time you moved item - source and target collections will be updated.

          • 2. Re: listShuttle interoperability
            David Gilks Newbie

            Thanks !
            That does exactly what i need.
            :-)

            • 3. Re: listShuttle interoperability
              David Gilks Newbie

              One more thing (should anyone want to do the same thing as I was), each listShuttle needs to be within its own 'a4j:region' else sometimes the reRender does not update properly.

              e.g.

              <a4j:region id="groupingListShuttleReg">
              <rich:listShuttle id="groupingListShuttle"
              sourceValue="#{Controller.sourceShuttleList}"
               targetValue="#{TestFilterBean.groupingList}"
               var="item" sourceCaptionLabel="Data available for grouping" targetCaptionLabel="Group data by"
              sourceListWidth="150" targetListWidth="150"
               showButtonLabels="false" fastMoveControlsVisible="false" listsHeight="250" converter="TestFieldConverter">
               <rich:column>
               <h:outputText value="#{item.description}" />
               </rich:column>
              </rich:listShuttle>
              </a4j:region>