8 Replies Latest reply: Jan 21, 2011 6:44 AM by Ilya Shaikovsky RSS

    RF 4.0 M4 SEVERE problem

    Ilya Sorokoumov Master
      <h:form id="form1">
                  <h:inputText value="#{testBean.input}"></h:inputText>
                  <a4j:commandLink render="form2Wrapper" execute="@form" value="Render">
                  </a4j:commandLink>
              </h:form>
              <h:panelGroup id="form2Wrapper">
                  <h:form id="form2" rendered="#{! empty testBean.input}">
                      <h:commandButton value="Test1" action="#{testBean.doSomething}"/>
                      <h:commandLink value="Test2" action="#{testBean.doSomething}"/>
                  </h:form>
              </h:panelGroup>W

       

      This is code of my xhtml page:

       

      <h:form id="form1">
                  <h:inputText value="#{testBean.input}"></h:inputText>
                  <a4j:commandLink render="form2Wrapper" execute="@form" value="Render">
                  </a4j:commandLink>
              </h:form>
              <h:panelGroup id="form2Wrapper">
                  <h:form id="form2" rendered="#{! empty testBean.input}">
                      <h:commandButton value="Test1" action="#{testBean.doSomething}"/>
                      <h:commandLink value="Test2" action="#{testBean.doSomething}"/>
                  </h:form>
              </h:panelGroup>
      
      

       

      And this is my TestBean class:

       

      /**
       * @author sorokoumov
       */
      @SessionScoped
      @ManagedBean
      public class TestBean {
      
          private String input;
      
          public String getInput() {
              return input;
          }
      
          public void setInput(String input) {
              this.input = input;
          }
          
          public String doSomething() {
              System.out.println("doSomething");
              return null;
          }
          
      }
      

       

      When I input something into h:inputText it shows me the second form.

      But when I press the button or the link on the second method of

      testBean is not getting call and the page is just rerendered.

      If I press the button or the link at the second time it works fine and calls testBean method.

       

      Is it a bug in a4j or may be I'm missing something?

       

      P.S. I'm using GlassFish 3.0.1 and RF 4.0 M4.