2 Replies Latest reply on Dec 12, 2011 2:44 PM by Suzanne Blourtchian

    problem with too may request to RichFaces modalPanel

    Suzanne Blourtchian Newbie

      Hello everyone,

      I am working with richfaces, using menu that popups modalPanel. The menu comes up when user clicks on a rich extendedDataTable row. When the row is clicked, and the menu appears, any selection the the menu pops up specific modalPanel which contains data specific to the table row. The problem comes where user clicks on rows one after another several times, the contained data inside the popup modal doesn’t get refreshed sometimes. I am using delayRequest to make some delays, but still the problem keeps happening. Any other attribute should I use?

        • 1. Re: problem with too may request to RichFaces modalPanel
          Christian Peter Expert

          I'd use the oncomplete event to show the modal panel. There should also be a reRender attribute to redraw the contents of the modalpanel. If you use a4j:status you could prevent multiple requests.

           

          for reRendering the contents of a modalpanel I almost always use the following approach:

           

          <rich:modalPanel id="mymp">

               <h:form id="mympForm">

                    <a4j:outputPanel id="refreshMe">

                         ...

                         #{mydata.whatever}

                    </...

          ...

          </rich:modalPanel>

           

          to show:

           

          <a4j:commandLink value="open" action="#{dosome.action}" reRender="mympForm:refreshMe" oncomplete="#{rich:component('mymp')}.show();"/>

           

          using a rich:menuItem should be quite similar!

          • 2. Re: problem with too may request to RichFaces modalPanel
            Suzanne Blourtchian Newbie

            Thank you for the help, still is not working. After few clicks to table rows, data is not getting refreshed. It does get refreshed for first 4 or 5 time request. Then it shows teh previous contain after 4 or 5 request sent. The modalPaned is using the rich:dataTable. This is the code

             

            modalPAnel:

            <rich:modalPanel id="myPanel" width="450" height="490">
            .
            .

            <h:form id="mympForm">
               <div style="width:100%;height:420px;background-color:#ffffff;overflow:auto;margin-bottom:10px;">
            <a4j:outputPanel id="DemoContainer">




            menuItem function call:

            <a4j:jsFunction id="showDemoPanel" name="showDemoPanel" requestDelay="50" ignoreDupResponses="false" oncomplete="showDemoPanel2();">
            <a4j:actionparam name="clickedKey" assignTo="#{someHandler.clickedBeanKey}"/>
            </a4j:jsFunction>
            <a4j:jsFunction id="showDemoPanel2" name="showDemoPanel2" requestDelay="500" ignoreDupResponses="true"
            reRender="mympForm:DemoContainer" oncomplete="Richfaces.showModalPanel('myPanel');focusFunction('stop');"/>