4 Replies Latest reply on Feb 8, 2013 2:16 AM by strannik

    rich:popupPanel and "hide" event

    strannik

      Hi

       

      I would like to attach to "hide" event of the popup panel and execute some user-defined code.

       

      <rich:popupPanel  domElementAttachment="form">
      <a4j:ajax event="hide"
      listener="#{selectionBean.clear()}" />

       

      However this code doesn't work as expected. The listener is not invoked.

       

      If I use event directly: <rich:popupPanel onhide="clearSelection" />

       

      <a4j:jsFunction name="clearSelection"
      action="#{selectionBean.clear()}" />

       

       

      the server-side function is also not called.

      Please advise.

        • 1. Re: rich:popupPanel and "hide" event
          sivaprasad9394

          Hello Morenets,

           

          Using the below code,when you hide the model panel you can call the action,Instead of using rich:componentControl i have used like beloe....

           

          <rich:modalPanel id="showTransModal" styleClass="transactionShowModal" width="800" height="500" moveable="false" resizeable="false" autosized="true">

          <f:facet name="header">

                      <h:panelGroup>

                          <h:outputText value="12345" styleClass="modalPanel12"></h:outputText> //Model panel header message

                      </h:panelGroup>

          </f:facet>

                  <f:facet name="controls">

                      <h:panelGroup>

                         <h:commandLink  id="closelink"  

                                      action="#{urBean.clearMessages}">

                                      <h:graphicImage value="../_assets/image/close.png"

                                          style="border:0" alt="Close" title="Close" />  // This is the close button link where you can call the backend bean class

                           </h:commandLink> 

                      </h:panelGroup>

                  </f:facet>

           

           

              ************************* do your code here ***************************************

          </rich:modalPanel>

           

          Thanks,

          Siva

          1 of 1 people found this helpful
          • 2. Re: rich:popupPanel and "hide" event
            strannik

            Hi, Siva

             

            Thank you for the quick response. I understand your workaround and actually I did as you suggested.

             

            However I still have no clue if RF supports hide/onhide attribute as it is written in the official documentation.

            • 3. Re: rich:popupPanel and "hide" event
              michpetrov

              Hi,

               

              I am not sure why it doesn't work with a4j:ajax but it is working with jsFunction, you just have to use parentheses when calling that function:

               

              <rich:popupPanel onhide="clearSelection()" …>

              • 4. Re: rich:popupPanel and "hide" event
                strannik

                Thank you, Michal.

                 

                It works for me with jsFunction.