1 Reply Latest reply on Mar 28, 2012 4:09 PM by pdhung3012

    a4j:commandButton in rich:popupPanel not submitting input

    daxxy

      I think this is the same problem described here https://community.jboss.org/message/566382 and here https://issues.jboss.org/browse/RF-9529 . A workaround was identified, but I was wondering if any more information has come to light since these were created that actually solves this problem.

       

      I am using Richfaces 4.2.0.Final.

       

      index.xhtml:

       

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

      <body>
        <h:head>
          <title>RichFaces Application</title>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        </h:head>

        <h:form>

          <a4j:commandButton execute="@this" render="editPanel"
            oncomplete="#{rich:component('editPanel')}.show()" value="Edit">
          </a4j:commandButton>

          <rich:popupPanel id="editPanel">
            <h:panelGrid columns="2">
              <h:outputText value="test string" />
              <h:inputText id="innm21" value="#{testClass.testString}" />
            </h:panelGrid>


            <a4j:commandButton value="Save" action="#{testClass.fireAction}"
              render="list newcontact" execute="editPanel" />
            <a4j:commandButton value="Cancel"
              onclick="#{rich:component('editPanel')}.hide(); return false;" />
          </rich:popupPanel>

        </h:form>

      </body>
      </html>


      managed bean is here


      @ManagedBean
      @ViewScoped
      public class TestClass {
         
          String testString;

          public String getTestString() {
              return testString;
          }

          public void setTestString(String testString) {
              this.testString = testString;
          }
         
          public String fireAction(){
              System.out.println("here is the testString: "+testString);
              return "done";
          }
         

      }


      When I click "Save" I get this output


      09:43:24,999 INFO  [stdout] (http--0.0.0.0-8080-3) here is the testString: null


      setTestString is never called

      Has anyone figured out how to fix this by now?