4 Replies Latest reply on Jul 13, 2009 3:29 PM by Chris Mathrusse

    Conditionally rendering a button a modalDialog

    Chris Mathrusse Newbie

      I'm using RichFaces 3.3.1 GA.

      I'm attempting to conditionally render a button on a modalDialog but I'm having no success. I am displaying a rich:dataTable on the main page and have added a rowClickAction as follows:

      <a4j:support id="rowClickAction" event="onRowClick"
       action="#{distributionSieve.selectAction}"
       oncomplete="#{rich:component('sieveEdit')}.show()"
       reRender="sieveEditInfo, editIncludeCheckbox, editSieveName, editOrganizationList, editButtonDelete"/>


      The button on the dialog is defined as follows:

      <a4j:commandButton
       id="editButtonDelete"
       oncomplete="#{rich:component('sieveDelete')}.show()"
       value="#{msgs.buttonDelete}" actionListener="#{distributionSieve.confirmDeleteYes}"
       rendered="#{distributionSieve.deleteRendered}"
       reRender="sieveTable"/>


      My backing bean has a boolean property (isDeleteRendered) defined and it's value is based upon the row selected. But no matter what I try the button is not rendered. I've set a breakpoint in the backing bean to verify the value of this variable, which is always set to true when a row is selected. The default value for this variable is false when the entire page is initially rendered, but it is updated to true when a row is selected.

      So what am I doing incorrect? Why doesn't this button render as expected like the other controls on the dialog?

      Thanks for the help...