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

    rich:popupPanel and "hide" event

    Sergey Morenets Novice



      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
          Siva P Master

          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:outputText value="12345" styleClass="modalPanel12"></h:outputText> //Model panel header message



                  <f:facet name="controls">


                         <h:commandLink  id="closelink"  


                                      <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






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





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

            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
              Michal Petrov Master



              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
                Sergey Morenets Novice

                Thank you, Michal.


                It works for me with jsFunction.