4 Replies Latest reply on Nov 5, 2012 4:37 AM by renyoumad

    RichFaces a4j:status problem in richfaces 4.2.2

    pdhung3012

      Hello everybody.

       

      I want to take an <a4j:status> into my page for loading when i have action.

       

      Here is my code:

       

      <f:view contentType="text/html" encoding="UTF-8">

              <h:form id="form1"> 

      ....

       

      <h:commandButton id="btnXuLy" styleClass="google_action_buttonClass" action="#{indexBean.uRLProcessAction()}" value="Xử lý"/>

       

      .....

       

      </h:form>

      <a4j:status>     

      <f:facet name="start">

      <h:graphicImage value="#{utilBean.viewRedirectString('/resources/images/icon_loading.gif')}" alt="icon loading" />

      </f:facet>

              </a4j:status>

      </f:view>

       

      Unfortunately, the loading is not working. I've checked image and it load ok.

       

      What's my fault?

        • 1. Re: RichFaces a4j:status problem in richfaces 4.2.2
          healeyb

          I ended up doing it like this:

           

          <h:outputScript name="jquery.js"/>

           

          <h:form prependId="false">

           

          <h:graphicImage id="ajaxBusy" style="visibility: hidden" .../>

           

          a4j:status onstart="jQuery('#ajaxBusy').css('visibility','visible')"

                         onstop="jQuery('#ajaxBusy').css('visibility','hidden')"

                         onerror="jQuery('#ajaxBusy').css('visibility','hidden')"/>

           

          Note that I found visibility: hidden better than display: none because the former reserves space in the DOM and doesn't

          move other elements about as can happen with display: none.

           

          NOTE: for this to work, you're going to need to use a4j:command...or h:command... with a child a4j:ajax tag (latter not

          tested but ought to work).

           

          Regards,

          Brendan.

          • 2. Re: RichFaces a4j:status problem in richfaces 4.2.2
            pdhung3012

            Thank you for your help .

             

            Finally I found my mistake.

             

            this a4j:support tag works only for <a4j:commandButton>, commandLink... not h:command

            • 3. Re: RichFaces a4j:status problem in richfaces 4.2.2
              healeyb

              Ah RF3, not RF4. Can't actually remember why I ended up using onstart rather than facets, presumably the

              only way I could get it to work. Glad you've solved it anyway.

              • 4. Re: RichFaces a4j:status problem in richfaces 4.2.2
                renyoumad

                I have a project. The status can't work when i add a h:commandLink in page, removed it, all is ok.