5 Replies Latest reply on Jan 31, 2008 10:10 AM by holstead

    a4j:status and Loading message

      Hi All Experts,
      We are using Jsf1.1 and a4j in our application.We are having a requirement wherein , when there is an ajax call being made , we need to show status message ...sumthing like "Loading Please wait" with an image.
      Basically, on start of ajax call, we need to have a modal window with the loading imgae in center of the page and it should go away as soon as ajax call ends.

      Can any one guide me as to how i can have a modal window with "In Progress" message for a4j - ajax calls.


      I tried fololowing the below example:
      http://www.jroller.com/wesleyhales/entry/adding_lightbox_to_ajax4jsf_and

      but it does not seems to work or rather am doing wrong somthing somewhere.
      In my case when the jsp is loaded, the form fields on the page gets locked and I'm not able to click on any form feilds.
      find below snap shot of the jsp code:







      ...........
      ...........................

      <a4j:status forceId="true" id="ajaxStatus">
      <f:facet name="start">

      </f:facet>
      </a4j:status>


      Can any one suggest me where am going wrong or if any one has different approach for this problem.
      I'm sure this a very common problem and you guys must have got some solution to it.

      If needed , i can post the files.
      Thanks and Regards.
      Ved

        • 1. Re: a4j:status and Loading message
          ralf.mueller

          Here is an working example:

          <h:form id="form" enctype="multipart/form-data">
          <a4j:status id="ajaxStatusId" onstart="Richfaces.showModalPanel('form:ajaxLoadingModalBox',{width:450, top:200})" onstop="Richfaces.hideModalPanel('form:ajaxLoadingModalBox')" />
          .....

          This is the modal panel:

          <rich:modalPanel id="ajaxLoadingModalBox" minHeight="125" minWidth="250"
          height="75" width="250" zindex="2000" style="background-color: #FFFFFF; width: 100%; border-width: 1px; border-color: black; border-style: solid; text-align: center;">
          <f:facet name="header">
          <h:outputText value="#{msg.titel_globalWait}"/>
          </f:facet>
          <h:panelGrid columns="1" style="width: 100%; border-width: 0px; text-align: center;">
          <h:outputText value="#{msg.global_pleaseWait}" style="font-weight: bold;"/>
          <h:graphicImage value="/app/images/progressbar.gif"/>
          </h:panelGrid>
          </rich:modalPanel>

          and this is the component:

          <a4j:commandButton styleClass="standardButton"
          action="#{chassis.save}"
          value="#{msg.global_save}"
          status="ajaxStatusId" ajaxSingle="false"
          immediate="false" />

          • 2. Re: a4j:status and Loading message
            holstead

            I just implemented this technique and its working, however the modalPanel only shows for the first request for each component and not subsequent requests. Any ideas why?

            eg: I have a selectOneMenu that onchange populates a datatable. On the first change it shows/hides the modal. When selecting another value the modal is absent.

            Thanks.

            • 3. Re: a4j:status and Loading message
              holstead

              I replaced the richfaces.showModalPanel and richfaces.hidModalPanel calls with my javascript functions so I could see whats getting called. I'm noticing AFTER the first request from each component it only triggers the onstop function. hmm?

              • 4. Re: a4j:status and Loading message
                holstead

                found someone already submitted bug:

                http://jira.jboss.org/jira/browse/RF-1990

                • 5. Re: a4j:status and Loading message
                  holstead

                  Issue not showing 3.1.4 GA, yay.