3 Replies Latest reply on Feb 29, 2012 6:42 AM by healeyb

    Server Side Richfaces PopUp not showing

    jsf_pk

      Hi,

       

      searchResults.xhtml - Relates to SearchResultActionBean.java


      <a4j:commandButton value="View Wages" action="#{viewWageBean.viewWages}"/> ------------------1

      -----------------------------------------------------------------------------------------

      <rich:popupPanel id="Message_info" model="true" rendered="#{viewWageBean.isInfoMessageAvailable()}" styleClass="tablecenter" autosized="true">

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

                          <h:panelGrid>

                              <h:outputText value="#{viewWageBean.infoMessage}"></h:outputText>

                              <h:commandButton value="OK" action="payroll"></h:commandButton>

                              <h:commandButton value="CANCEL">

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

                              </h:commandButton>

                          </h:panelGrid>

      </rich:popupPanel>

       

      ViewWageBean.java - ManagedBean and Session Scoped

       

      public boolean isInfoMessageAvailable(){

              if(getInfoMessage()!=null){

                  return true;

              }

              return false;

          }

          /**

           * @return the infoMessage

           */

          public String getInfoMessage() {

              return infoMessage;

          }

       

          /**

           * @param infoMessage the infoMessage to set

           */

          public void setInfoMessage(String infoMessage) {

              this.infoMessage = infoMessage;

          }

       

      public String viewWages(){     -----------------------2

      ......

      if(aggTypeSize > 0){

       

      }else{

          

      message = " Aggregation: Not Aggregated" +

                                      " No aggregation types recorded for this request, reply combination. "+

                                      " Please contact helpdesk quoting the " +

                                      " Social Security number and Reply Date. " +

                                      " Would you like to view Payroll Details.";

                             setInfoMessage(message);  --------------------  3

                              return null;

      }

       

      }

       

      Could you please help me how to resoolve this issue. Dynamic Popup is not displaying when the search results page is displaying?

       

      I am returning null in the viewWages(). So, it will go back to searchResults.xhtml from the ViewWagesBean.java. But the pop up is not displaying?Pop up has show attribute to read the boolean method in the view wage bean, if the message is available it will return true and the pop up should display.

        • 1. Re: Server Side Richfaces PopUp not showing
          healeyb

          The View Wages commandButton would need to render="Message_info", but the target of the render must be

          permanently resident in the DOM, which your popupPanel isn't because it's using rendered=. Replace

          popupPanel rendered= with show=, and add render="Message_info" to the commandButton and try again.

          • 2. Re: Server Side Richfaces PopUp not showing
            jsf_pk

            Thanks Brendan,

             

            It works fine... I faced another problem that message is retaining the value (my bean is in session scope) when ever I click View Wage button. So, added a action listener to check if it not null then null the object. So, it is working good.

            • 3. Re: Server Side Richfaces PopUp not showing
              healeyb

              So, it just worked? awesome. That doesn't happen very often. The normal way of doing things is to have

              a container (h:panelGroup) inside the popupPanel. Then you render the id of the panelGroup, otherwise

              the content will be stale.

               

              All the best.

               

              Regards,

              Brendan.