2 Replies Latest reply on Jun 8, 2007 8:14 AM by Julien Martin

    show/hide an outputpanel using a4j

    Julien Martin Expert


      I am trying to show/hide an outputpanel when a user clicks a button all this using ajax.

      I was not able to find any "render" attribute instead of the reRender one. Can anyone please help?


       <a4j:outputPanel ajaxRendered="true">
       <h:messages />
       <a4j:commandButton action="#{TheManagedBean.theAction}" reRender="the-hidden" immediate="true" value="Click"/>
       <h:outputText value="#{TheManagedBean.componentRendered}"/>
       <a4j:outputPanel id="the-hidden" rendered="#{TheManagedBean.componentRendered}">
       <h:outputText value="hello world"></h:outputText>

      package pack;
       * @author jumartin
      public class TheManagedBean {
       private boolean componentRendered;
       public String theAction(){
       componentRendered = true;
       return "ok";
       public boolean isComponentRendered() {
       return componentRendered;
       public void setComponentRendered(boolean componentRendered) {
       this.componentRendered = componentRendered;