2 Replies Latest reply on Dec 8, 2011 8:59 AM by guillaume.lancelin

    RF 4.1 : a4j:status and h:commandLink

    guillaume.lancelin

      Hi all,

       

      The a4j:status tag seems not to work when a h:commandLink tag is in the same page.

       

      I made a little example to test it.

       

      The bean :

      package fr.mycompany.test;

       

      import javax.enterprise.inject.Model;

      import javax.inject.Inject;

       

      import org.jboss.logging.Logger;

       

      @Model

      public class Test {

       

          @Inject

          private Logger logger;

       

          public String launch() {

              for (int i = 0; i < 20000; i++) {

                  logger.debug(i);

              }

       

              return null;

          }

      }

       

      The page :

      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j"

          xmlns:rich="http://richfaces.org/rich"

          xmlns:s="http://jboss.org/seam/faces" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets">

      <h:head />

      <h:body>

          <a4j:status id="status" onstart="#{rich:component('processingPopup')}.show()" onstop="#{rich:component('processingPopup')}.hide()" startText="en cours" stopText="fini" />

          <rich:popupPanel id="processingPopup" modal="true" styleClass="popupSouscription" autosized="true" show="false">

              Traitement en cours ...

          </rich:popupPanel>

          <h:form id="leForm">

              <a4j:commandLink value="a4j commandLink" action="#{test.launch}" id="a4jLink" /><br/>

              <h:commandLink value="h commandLink" action="#{test.launch}" id="hLink" />

          </h:form>

          <a4j:log id="logs" style="width: 1400px; height: 600px; overflow: scroll;" />

      </h:body>

      </html>

       

      When I click on the a4j:commandLink the a4j:status doesn't work and the following log appears :

      info [18:25:14.390]: Received 'begin' event from <a id=leForm:a4jLink ...>

      info [18:25:15.251]: Received 'beforedomupdate' event from <a id=leForm:a4jLink ...>

      debug[18:25:15.252]: Server returned responseText: <?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="javax.faces.ViewState"><![CDATA[5271447831659883319:-888481348828354087]]></update></changes></partial-response>

      info [18:25:15.253]: Listing content of response changes element:
      Element update for id=javax.faces.ViewState
      <update id="javax.faces.ViewState"><![CDATA[5271447831659883319:-888481348828354087]]></update>

      info [18:25:15.255]: Received 'success' event from <a id=leForm:a4jLink ...>

      info [18:25:15.256]: Received 'complete' event from <a id=leForm:a4jLink ...>

       

      If I remove the line <h:commandLink value="h commandLink" action="#{test.launch}" id="hLink" /> and then click on the a4j:commandLink the a4j:status works and the following log appears :

      debug[18:28:17.277]: New request added to queue. Queue requestGroupingId changed to leForm:a4jLink

      debug[18:28:17.277]: Queue will wait 0ms before submit

      debug[18:28:17.278]: richfaces.queue: will submit request NOW

      info [18:28:17.282]: Received 'begin' event from <a id=leForm:a4jLink ...>

      info [18:28:17.905]: Received 'beforedomupdate' event from <a id=leForm:a4jLink ...>

      debug[18:28:17.906]: Server returned responseText: <?xml version='1.0' encoding='UTF-8'?> <partial-response><changes><update id="javax.faces.ViewState"><![CDATA[-4055820746262438471:-5740665287677042238]]></update></changes></partial-response>

      info [18:28:17.908]: Listing content of response changes element:
      Element update for id=javax.faces.ViewState
      <update id="javax.faces.ViewState"><![CDATA[-4055820746262438471:-5740665287677042238]]></update>

      debug[18:28:17.909]: richfaces.queue: ajax submit successfull

      debug[18:28:17.910]: richfaces.queue: Nothing to submit

      info [18:28:17.913]: Received 'success' event from <a id=leForm:a4jLink ...>

      info [18:28:17.914]: Received 'complete' event from <a id=leForm:a4jLink ...>

       

      Is this a bug ? Can someone help me ?

       

      I'm using Java 1.6.0_29, JBoss 6.1, mojarra 2.0.3_b5, RF 4.1.0-CR2 (but the problem already existed with previous version), Seam 3.0.0-Final.