5 Replies Latest reply on Feb 13, 2012 6:20 AM by Logan M

    Why does my a4j:commandButton not work when not rendered on pageload?

    Bernhard Hurzeler Novice

      My a4j:commandButton does not work if it has not been rendered when the page was loaded.

       

      Try the following:

       

          <h:form>

              <h:selectBooleanCheckbox value="#{showpnl}">

                  <a4j:support event="onclick" reRender="pnl" />

              </h:selectBooleanCheckbox>

       

              <a4j:outputPanel id="pnl">

                  <a4j:outputPanel rendered="#{showpnl}">

                      <h:inputText value="#{text}" />

                      <a4j:commandButton value="Go" reRender="out" />

                  </a4j:outputPanel>

              </a4j:outputPanel>

       

              <h:outputText id="out" value="Text: #{text}" />

          </h:form>

       

      It works if you set: <a4j:outputPanel rendered="true"> on line 7 !!! Why?