2 Replies Latest reply on Apr 10, 2013 12:58 PM by gmlussi

    a4j:ajax listener doesn't work with a4j:push

    mogaba

      Hello,

       

      I used this article to start with push. I added listener to a4j:ajax, but the method isn't invoked:

      <a4j:push address="sampleAddress">
          <a4j:ajax event="dataavailable" listener="#{pushModel.increment}" render="out" />
      </a4j:push>
      

      The increment() method:

      public void increment() {
              System.out.println("count incremented");
              ++count;
      }
      

      I use Richfaces 4.2.3 with Glassfish 3.1.2.2 (also tried Tomcat 7).

        • 1. Re: a4j:ajax listener doesn't work with a4j:push
          mogaba

          I've found a workaround:

           

          <a4j:jsFunction name="update" actionListener="#{pushModel.increment}"
                      render="out" />
          <a4j:push address="sampleAddress" ondataavailable="update()" />
          

           

          It wouild be nice if a4j:ajax listener would work, though. Is it a bug or something?

          • 2. Re: a4j:ajax listener doesn't work with a4j:push
            gmlussi

            I have come across the exact same problem (using Richfaces 4.3.1)... the listener attribute does not work/trigger from an <a4j:ajax inside of an a4j:push. So, thanks for the workaround.

             

            Hopefully somebody can elaborate on this... is there a reason, or it a bug that should be raised formally?