3 Replies Latest reply on Aug 5, 2008 6:14 AM by charishma

    Script api for ListShuttle

    charishma

      Hi

      I am using a list shuttle with 3 columns. I need to change the value of 3rd column when the values are moved back n forth. Is there a way to get the selected Id/Index in javascript to change the value of selected row? Something like document.getElementById('form:listShuttleId:'+selectedIndex+':columnId')

      Is there some other way of doing it other than javascript?

        • 1. Re: Script api for ListShuttle
          charishma

          $('entityMapForm:menuList').component.getSelection() is not working either.

          • 2. Re: Script api for ListShuttle
            ilya_shaikovsky

            Please describe step by step your use case more carefully in order to make sure we talking about the same. And I'll explore it with LS component developer.

            • 3. Re: Script api for ListShuttle
              charishma

              I have a listShuttle as below:

              <rich:listShuttle id="menuList" sourceValue="#{BackingBean.defaultMenu}" targetValue="#{BackingBean.deniedMenu}" var="menu" listsHeight="300"
              targetListWidth="400" sourceListWidth="400" sourceCaptionLabel="Granted:" targetCaptionLabel="Denied:"
              copyControlLabel="Deny" removeControlLabel="Grant"
              copyAllControlLabel="Deny all" removeAllControlLabel="Grant all"
              fastOrderControlsVisible="false" orderControlsVisible="false" converter="menuDTOConverter" onremoveclick="getselvalue();">
              <rich:column id="menuCode">
              <f:facet name="header">
              <h:outputText styleClass="headerText" value="Menu Code" />
              </f:facet>
              <h:outputText id="id1" value="#{menu.menuCode}"/>
              </rich:column>
              <rich:column id="optionName">
              <f:facet name="header">
              <h:outputText styleClass="headerText" value="Option Name"/>
              </f:facet>
              <h:outputText id="id2" value="#{menu.optionName}" />
              </rich:column>
              <rich:column id="exceptionType">
              <f:facet name="header">
              <h:outputText styleClass="headerText" value="Excp"/>
              </f:facet>
              <h:outputText id="id3" value="#{menu.exceptionType}" />
              </rich:column>
              </rich:listShuttle>

              I need to set a value 'x' for 'id3' when record is moved using 'Copy' and 'Remove'. So if I could get the seleted item or the moved item Id or index(either 0 or t0), I can set the field value to 'x'.

              Hope I am clear about the requirement.