3 Replies Latest reply on Apr 30, 2007 12:09 PM by John Ruffin

    Dynamic modelPanel using java

    John Ruffin Newbie

      I'm hoping I can use the modelPanel or something similar in this scenario:

      I have an app that uses Spring/Hibernate/MyFaces/Ajax4Jsf. I have some PointCuts that let Aspects work their magic when a saveOrUpdate() method is called on manager interfaces.

      This magic syncs data to multiple databases using a few web services via WebMethods.

      Problem is: when a user saves - lets say a customer - it takes a while for all the sync'ing to happen.

      I want to know if I can throw up a modalPanel when the save button is clicked and hide it when I get a response from the web service. Ideally, I'd like to display a message in the modalPanel depending on the response.

      I see in the developer's guide that you can dynamically show the modalPanel using java but no how-to.

      org.richfaces.component.html.HtmlModalPanel myPanel = new org.richfaces.component.html.HtmlModalPanel();

      Thanks in advance.

        • 1. Re: Dynamic modelPanel using java
          John Ruffin Newbie

          Sorry for the ping...
          Anyone have an example of a dynamic modalPanel using java? I think it would be great in the scenario I mentioned. Am I right in this usage?

          • 2. Re: Dynamic modelPanel using java
            Sergey Smirnov Master

            What I really do not understand is why you decide to create modal panel dynamically in your case. I do not find even one small reason.

            If the "Save" button is not an Ajax button, the functionality seems very primitive - the modal panel with "Please, wait" label is triggered by onclick attribute of the button. When the response comes, the new page is displayed (modal panel is gone without any action from your side)

            • 3. Re: Dynamic modelPanel using java
              John Ruffin Newbie

              Thanks for the clarity Sergey...

              I added this to my a4j:commandButton

              onclick="Richfaces.showModalPanel('invoicetoForm:mp1', {top:100, left:100})

              Added a base panel like this:

              <rich:modalPanel id="mp1" minHeight="100" minWidth="200" height="200" width="400" zindex="300">
               <t:outputText value="Hold tight..."/>

              and it worked.

              Thanks again!