1 Reply Latest reply on Nov 21, 2007 8:56 PM by Sergey Smirnov

    Richfaces sample using <a4j:support> not working

    Kishore R Newbie

      I have been having problems getting the <a4j:support> tag to work for me. So I decided to try out an example provided with the Richfaces distro.

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib" lang="en"
       <a4j:keepAlive beanName="rsBean2" />
       <h:inputText size="4" label="First Addent" value="#{rsBean2.addent1}">
       <a4j:support event="onkeyup" reRender="btn2" />
       <h:outputText value="+"/>
       <h:inputText size="4" label="Second Addent" value="#{rsBean2.addent2}">
       <a4j:support event="onkeyup" reRender="btn2" />
       <a4j:commandButton style="margin:0 5px" id="btn2" action="#{rsBean2.doSum}"
       value="=" reRender="sum2"
       disabled="#{rsBean2.addent1 == null or rsBean2.addent2==null}"/>
       <h:outputText id="sum2" value="#{rsBean2.sum}" />
       <a4j:outputPanel ajaxRendered="true">
       <h:messages />

      and the backing bean
      import org.jboss.seam.annotations.Name;
      public class RSBean {
       private Integer addent1;
       private Integer addent2;
       private Integer sum;
       public String doSum() {
       sum = new Integer((addent1 != null ? addent1.intValue() : 0) + (addent2 != null ? addent2.intValue() : 0));
       return null;
       public Integer getAddent1()
       return addent1;
       public void setAddent1(Integer addent1)
       this.addent1 = addent1;
       public Integer getAddent2()
       return addent2;
       public void setAddent2(Integer addent2)
       this.addent2 = addent2;
       public Integer getSum()
       return sum;
       public void setSum(Integer sum)
       this.sum = sum;

      I tried the example with all the major browsers.
      I dont see the <a4j:support> events being fired at all and the button stays disabled. What am I doing wrong here? Any ideas highly appreciated.

      Thanks in advance