0 Replies Latest reply on Nov 5, 2011 7:38 AM by Hauke Gulich

    a4j:push address attribute value

    Hauke Gulich Newbie



      I have a simple question, what does I need to put into the attribute of a4j:push?

      I read the chat-example, but I don't get it.


      What I want is that as soon as somebody write a message to the topic notify, some components should be rerendered.


      I am using richfaces 4 and JBoss 7, so I configured a topic like this inside my standalone.xml file




                  <jms-topic name="notify">
                      <entry name="topic/notify"/>



      And I created a simple xhtml file like this:




      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


      <html xmlns="http://www.w3.org/1999/xhtml"
















                  <rich:panel styleClass="navigationPanel" header="Navigation">


                      <h:outputText id="dummytext" value="Value is #{testing.randomValue}"></h:outputText>




                  <a4j:push address="@notify">

                      <a4j:ajax event="dataavailable" render="dummytext" execute="@none" />











      And my bean looks like this




      package de.hauke.client.bean;


      import javax.faces.bean.ManagedBean;

      import javax.faces.bean.SessionScoped;


      @ManagedBean (name="testing")


      public class TestingBean {


          private String randomValue;


          public String getRandomValue() {


              int zahl = (int)(Math.random() * 1000 + 1);


              return String.valueOf(zahl);



          public void setRandomValue(String randomValue) {

              this.randomValue = randomValue;







      So the value displayed on the page should be change if a message arrives.


      What do I have to write at the address-attribute in order to get this simple thing to work?


      Many greetings,