0 Replies Latest reply on Mar 28, 2012 5:45 PM by pdhung3012

    How to get itemValue in rich: orderingList in RichFaces 4.2.0

    pdhung3012

      Hello everybody.

      In this example, I created rich:orderingList and display the data input to it. However, I encountered a very annoying problem, it can not get the selected value of that List. The itemValue not working:

       

       

       

        <rich:orderingList listHeight="100px" id="lstSuggestion" var="label" itemValue="#{label}" onclick="alert('#{label.name}');" value="#{tC6Bean.lst}">

       

                          <f:converter converterId="orderConverter"/>

                          <a4j:ajax event="change" execute="lstSuggestion" render="errorText" listener="#{tC6Bean.viewSelectAction(label)}">                       

      </a4j:ajax>

                          <rich:column>

                              <f:facet name="header">Name</f:facet>

                             

      #{label.name}

                             

      </rich:column>

      </rich:orderingList>

       

      The Managed Bean

       

        public void viewSelectAction(LabelEntity lbl){

              try {

      alertError=Response.getAlertString("SelectValue: "+lbl.getName());

              } catch (Exception e) {

      alertError=Response.getAlertString("Error: "+e.getMessage());

              }

             

          }

       

      And when we click, the box show this:

       

      http://s970.photobucket.com/albums/ae190/swenteiger7/richFaces%20error-%20110312/?action=view&current=testcase6_error.png

       

       
      I have to use solution is put into a div orderingList item and event handlers <a4j: jsFunction div when clicking on it. But this way is not so regular.

      If you have time, welcome to visit my wordpress to view and download project demo of bugs( pleasechoose testcase 6)

       

      http://phandanghung.wordpress.com/2012/03/22/welcome-to-my-jsf-tutorial-project/