1 Reply Latest reply on Aug 16, 2008 3:45 PM by Matt Davis

    a4j:commandButton does nothing on first click

    Matt Davis Newbie

      When I click the button the first time, nothing happens. I stdout some text in the addDegree method that doesn't happen on the first click. I can put a javascript alert on the button, and it alerts the first time, and on subsequent clicks.

      The second click works fine, the data table updates with the added degree name. Any idea what is causing this?

      <rich:simpleTogglePanel switchType="client"
       label="Institution Information" height="150px" opened="false">
       <f:facet name="closeMarker">
       <h:graphicImage value="stylesheet/css-images/PnlHdr_down.gif" />
       <f:facet name="openMarker">
       <h:graphicImage value="stylesheet/css-images/PnlHdr_collapsed.gif" />
       <rich:dataTable value="#{orgApplication.degrees}" var="curDegree"
       width="750" id="degreeTable">
       <f:facet name="header">
       <h:outputText value="Applicant Academic Background"></h:outputText>
       <f:facet name="header">Degree Name</f:facet>
       <h:outputText value="#{curDegree.degreeName}" />
       <h:inputText value="#{orgApplicationBean.degree.degreeName}" />
       <a4j:commandButton value="Add Degree" reRender="degreeTable" action="#{orgApplicationBean.addDegree}" />

      public class OrgApplicationBackingBean implements OrgApplication{
       FacesMessages facesMessages;
       Degree degree = new Degree();
       EntityManager entityManager;
       OrganizationApplication organizationApplication = new OrganizationApplication();
       public void createMethod(){
       System.out.println("Creating orgapplicationbean");
       @Remove @Destroy
       public void destroy(){
       public void validateApplication(){
       public void addDegree(){
       System.out.println("in addDegree " + degree);
       if(degree != null){
       System.out.println("adding degree " + degree.getDegreeName());
       System.out.println("size: " + organizationApplication.getDegrees().size());
       degree = new Degree();
       public Degree getDegree() {
       return degree;
       public void setDegree(Degree degree) {
       this.degree = degree;
       public OrganizationApplication getOrganizationApplication() {
       return organizationApplication;
       public void setOrganizationApplication(
       OrganizationApplication organizationApplication) {
       this.organizationApplication = organizationApplication;

      public interface OrgApplication {
       public void destroy();
       public OrganizationApplication getOrganizationApplication();
       public void addDegree();
       public Degree getDegree();
       public void createMethod();