2 Replies Latest reply on Mar 3, 2012 10:48 AM by jsf_pk

    ValueChangeListener is not called in Rich:popup

    jsf_pk

      Hi,

      payrollDetail.xhtml


      <h:panelGrid columns="9" styleClass="tablecenter" cellspacing="5" cellpadding="5">

                          <a4j:commandButton value="Export To Excel" action="#{payrollDetailBean.export}"/>

                          <a4j:commandButton value="Print" action="#{payrollDetailBean.print}"/>

                         <a4j:commandButton value="Close" actionListener="#{payrollDetailBean.retrieveRequestStatus}" render="popup, selectRadioValue"/>

                      </h:panelGrid>

                     

                      <a4j:outputPanel id="popup" rendered="#{! payrollDetailBean.requestStatus}">

                          <script>

                             #{rich:component('RequestStatusPopUp')}.show();

                          </script>

                      </a4j:outputPanel>

                     

                     <rich:popupPanel id="RequestStatusPopUp" model="true" styleClass="tablecenter" autosized="true">

                          <f:facet name="header"><h:outputText value="Status Update"/> </f:facet>

                          <h:panelGrid columns="3" id="reqPanel">

                              <center>

                              <h:form id="statusForm">

                                      <h:selectOneRadio id="selectRadioValue" value="#{payrollDetailBean.requestStatus}" onchange="submit()">

                                          <f:selectItem itemValue="I" itemLabel="InComplete"/>

                                          <f:selectItem itemValue="C" itemLabel="Complete" />

                                          <f:selectItem itemValue="U" itemLabel="Unable to Complete"/>

                                          <f:valueChangeListener type="com.lm.cm.upswcs.ValueChangeListenerForBean" for="selectRadioValue"/>

                                      </h:selectOneRadio>

                                     

                                  <a4j:commandButton value="OK" action="#{payrollDetailBean.updateReqStatus}" execute="@this"/>

                                  <a4j:commandButton value="CLOSE">

                                      <rich:componentControl target="RequestStatusPopUp" event="click" operation="hide" />

                                  </a4j:commandButton>

                                  </h:form>

                                  </center>

                          </h:panelGrid>

                      </rich:popupPanel>   

       

      ValueChangeListenerForBean.java


      public void processValueChange(ValueChangeEvent arg0)

                  throws AbortProcessingException {

         

              newChangeValue = (String)arg0.getNewValue();

             

              PayrollDetailBean payBean = (PayrollDetailBean)JSFUtil.getBean("payrollDetailBean", FacesContext.getCurrentInstance());

              payBean.setReqStatus(newChangeValue);

      }

       

      PayrollDetailBean.java

       

      String requestStatus;

       

      public void retrieveRequestStatus(ActionEvent event){

              // get the current request status for the req id and rep id

              requestStatus = wageService.retrieveRequestStatus(getParamRequestId(), getParamReplyId());

        }

       

      When I click on CLOSE button in the payrollDetail.xhtml, a popup will be displayed. It has three radio values. When I change/select any radio item, the value change listener is not called. So, I cannot able to get the changed value.

       

      And, Only when I use execute = "@this", the OK button get called the action method in the PayrollDetailBean. If I remove the execute attribute, the OK button will not be called in the popup.

       

      Could you please tell me how to get the new value here?