0 Replies Latest reply on Nov 2, 2007 3:48 AM by Valentyn Polischuk

    AjaxListener not happen

    Valentyn Polischuk Newbie

      I lunch link "cLink" but not happen, field userBean.name not update(
      Plz need help

      <a4j:form>
      <h:outputText value="Press Any"/>
      <a4j:commandLink id="cLink" value="Click it To Send Ajax Request">
      <a4j:ajaxListener type="demo.UserBean"/>
      </a4j:commandLink>
      <a4j:commandButton value="Show MyPanel" actionListener="#{DemoList.processAction}" reRender="myPanel,statusPanel,serverName"></a4j:commandButton>
      <a4j:commandButton value="Update Status Panel" action="#{DemoList.processAct}" reRender="statusPanel"></a4j:commandButton>
      <a4j:region ajaxListener="userBean.processAjax">
      <h:outputText value="#{userBean.name}"></h:outputText>
      </a4j:region>
      </a4j:form>

      Java Source:
      package demo;

      import org.ajax4jsf.event.AjaxEvent;
      import org.ajax4jsf.event.AjaxListener;


      public class UserBean implements AjaxListener{

      private String name;
      private Long timer = 1000L;

      public UserBean(){
      }

      public String getName() {
      return name;
      }

      public void setName(String name) {
      this.name = name;
      }

      public Long getTimer(){
      return timer;
      }

      public void processAjax(AjaxEvent arg0) {
      this.name = name + "1";
      }
      }