1 Reply Latest reply on Dec 29, 2010 12:58 PM by Winster Jose

    Listshuttle causes problem: looks like a defect in listshuttle

    Winster Jose Newbie

      Please find my code below. The action of commandbutton is not triggered. The sourcevalue and targetvalue is a list of strings. My backing bean is having request scope.

      This is the error I am getting!

      Component dialog:shuttlelist has invalid value expression test1

       

      dialog is my form id. shuttlelist is my listshuttle id. test1 is a sample value set to available item. which is a string

      I can reach my action in 2 ways. Either change the scope from request to view. Or use immediate=true for commandbutton. But I dont want to use these 2. I want to stick on requestscope and immediate=true gets me empty values in backingbean.

       

      Whats going wrong here?

       

      <f:view>
      <h:form id="dialog">
      <a4j:jsFunction name="loadDialogDataJSF" action="#{dialogBean.loadDialogData}" reRender="shuttlelist"/>
      <h:panelGrid>
      <rich:listShuttle id="shuttlelist" sourceValue="#{dialogBean.availableItemsTest}"
                targetValue="#{dialogBean.selectedItemsTest}"
                var="items" listsHeight="150" sourceListWidth="152"
                targetListWidth="152" sourceCaptionLabel="Available Items"
                targetCaptionLabel="Selected Items">
      <rich:column>             
      <h:outputText value="#{items}" />
         </rich:column>                               
      </rich:listShuttle>
      <h:commandButton value="Submit" action="#{dialogBean.save}"/>
      </h:panelGrid>
      </h:form>
      </f:view>

      <f:view>

      <rich:messages/>

      <h:form id="dialog">

      <a4j:jsFunction name="loadDialogDataJSF" action="#{dialogBean.loadDialogData}" reRender="shuttlelist"/>

      <h:panelGrid>

      <rich:listShuttle id="shuttlelist" sourceValue="#{dialogBean.availableItemsTest}"

                 targetValue="#{dialogBean.selectedItemsTest}"

                 var="items" listsHeight="150" sourceListWidth="152"

                 targetListWidth="152" sourceCaptionLabel="Available Items"

                 targetCaptionLabel="Selected Items">

      <rich:column>

      <h:outputText value="#{items}" />

          </rich:column>  

      </rich:listShuttle> 

      <h:commandButton value="Submit" action="#{dialogBean.save}"/>

      </h:panelGrid>

      </h:form>

      </f:view>

       

       

       

      availableItemsTest = new ArrayList<String>();

      selectedItemsTest = new ArrayList<String>();

      availableItemsTest.add("test1");

      availableItemsTest.add("test2");

      availableItemsTest.add("test3");

        • 1. Re: Listshuttle causes problem: looks like a defect in listshuttle
          Winster Jose Newbie

          I dont understand what the heck is happening for listShuttle. I am able to correct the defect as below.

           

          I was injecting the sourcevalue and targetvalue to backingbean through a a4j:jsfunction in page load through body init.

          When I changed that to constructor it worked!

           

          I am totally disappointed with the listShuttle behaviour. Either the message should be correct or else there should be proper documentation. I had to go for trial and error method always which wastes my time a lot.