1 Reply Latest reply on Jan 27, 2011 1:28 AM by ilya40umov

    commandButton with rendered attribute not firing action

    raja4web

      Hi,

      I am facing some problem using a4j:commandbutton with rendered attribute. I have two buttons with same action attribute, with different rendered attribute.

      Here is the code for two buttons.

       

       

      <a4j:keepAlive beanName="adminHomePageBean" />
      ...
      
      <a4j:commandButton
           rendered="#{confirmMsgDialogBean.isUserActive}"
           value="Deactivate User"
           action="#{adminHomePageBean.updateUserStatusAction}"
           reRender="usersPanel">
      
                <f:param name="username" value="#{confirmMsgDialogBean.userName}" />
      
      </a4j:commandButton>
      
      <a4j:commandButton
           rendered="#{not confirmMsgDialogBean.isUserActive}"
           value="Activate User"
           action="#{adminHomePageBean.updateUserStatusAction}"
           reRender="usersPanel">
      
                <f:param name="username" value="#{confirmMsgDialogBean.userName}" />
      
      </a4j:commandButton>
      

       

       

      The buttons are rendered as they should be. But the action of the commandbutton is not invoked. there is also a4j:

      I am using richfaces 3.3.3

       

      Regards,

      Raja

        • 1. commandButton with rendered attribute not firing action
          ilya40umov

          1) Put rich:messages onto the page

          2) Are you sure that when you press a button value of EL wich is in rendered attribute still equals to true? Because if you press button which is not supposted to be on client JSF won't execute its action. Try to debug getter of confirmMsgDialogBean.isUserActive.

           

          P.S. Try to use a4j:actionparam because it's more convenient.