1 Reply Latest reply on Jul 28, 2009 10:55 AM by Ryan Yoder

    How to Invoke Modal Panel Conditionally?

    Sathesh Kumar Newbie

      Hi,

      Is there a way to invoke two different modal panels based on a condition from the ajax:commandButton.

      The Scenario is like this:

      I have two DB2 tables with Referential Integrity. When i delete a row from the table, if that row doesn't have any RI, then Delete Confirmation modal panel has to be displayed to the user.

      If that row has RI, then another modal panel which Warns the user this row is having a RI and Unable to delete the row.

      Thanks
      wiRichUser

        • 1. Re: How to Invoke Modal Panel Conditionally?
          Ryan Yoder Newbie

          Sure.

          Have one modal panel that renders a warning message and maybe doesn't have an OK button just a cancel button when the selected row has RI.
          Make sure you reRender this panel prior to display.

          Use an a4j:commandButton reRender="deletePanel" action="backingBean.preDelete" oncomplete="RichFaces.showModalPanel('deletePanel')"

          or something similar to that.
          The real trick is rerendering the panel prior to display.