3 Replies Latest reply on Oct 14, 2008 2:36 AM by Kim Eik

    a4j with checkbox not working

    Deepak Sawdekar Newbie

      Hi,

      What am I doing wrong. I have a simple xhtml page and backend bean as following.

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:a4j="http://richfaces.org/a4j"

      >


      <h:form>
      <h:inputText value="#{mytest.name}"/>
      <h:selectBooleanCheckbox value="#{mytest.checkvalue}" >
      <a4j:support id="rupali" event="onclick" ajaxSingle="true" reRender="deepak" ></a4j:support>
      </h:selectBooleanCheckbox>
      <h:outputText id="deepak" value="hello #{mytest.name}"/>

      Backend bean
      package com.cox.lguard.action;



      import org.jboss.seam.annotations.Name;


      @Name("mytest")
      public class mytest {
      private boolean checkvalue;
      private String name;
      public boolean isCheckvalue() {
      return checkvalue;
      }
      public void setCheckvalue(boolean checkvalue) {
      this.checkvalue = checkvalue;
      }
      public String getName() {
      return name;
      }
      public void setName(String name) {
      this.name = name;
      }
      }

      When I click or change the value of check box nothing happen.

      What am I missing.

      Regards
      Deepak