1 Reply Latest reply on Mar 7, 2014 3:12 AM by liumin hu

    Set value in rich:select via bean method

    Alex Davidovich Newbie

      hello,

      i created a rich:select with id="client" and a4j:ajax that triggers a bean method that copies the value from the

      client rich select and put it in another rich:select with id="doctor".

      I succeeded in executing the method when a value is selected in the client and changing the property but it does not show

      on the page.

       

      the first rich:select with ajax-

       

      <rich:select id="client" enableManualInput="true" value="#{orderManagementBean.order.ordererName}" selectItemClass="list">

                                 <a4j:ajax execute="@form" render="doctor" listener="#{orderManagementBean.copyDoctor}" event="selectitem"></a4j:ajax>

                                 <f:selectItems itemValue="#{orderManagementBean.order.ordererName}" value="#{orderManagementBean.clients}" />

                          </rich:select>

       

      the second rich:select -

      <rich:select  id="doctor"  enableManualInput="true" value="#{orderManagementBean.order.dentistName}" selectItemClass="list" hideNoSelectionOption="false" >

                             

                              <f:selectItems value="#{orderManagementBean.doctors}" />

                          </rich:select> 

       

      the bean method-

       

      public void copyDoctor(AjaxBehaviorEvent e)

          {

              Client doctor =  (Client) orderDao.getCodeByName(Client.class, order.getOrdererName());

             

              if (!doctor.isClinicInd())

              {

                  order.setDentist(doctor);

              }

          }

       

      after i chose a value in the "client" rich:select  and the method is executed, nothing happens to the doctor rich:select.

      any help will be appreciated!