2 Replies Latest reply on Aug 24, 2010 6:13 AM by Ilya Shaikovsky

    How to switch between modelPanels

    Bert Laverman Newbie

      I have an application that uses a modalPanel to offer a search dialog. One of the options there is a button to create a new entry rather than using one from the search results. For this I already have another modelPanel. I seem to be unable to find how to close the search panel and then open another.


      What is the correct way to do this?


      Bert Laverman



      why do I have 3 ways to close a modal?

      1)  #{rich:component('myModelPanel')}.hide()

      2) Richfaces.hideModalPanel('myModalPanel')

      3) using <rich:componentControl>

        • 1. Re: How to switch between modelPanels
          Siva P Master

          what ever method you are using before closing clear the previous search criteria and then close model panel.



          <a4j:commandButton id="btnCaptured" value="Close" styleClass="Black01"
          oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('modelPanelId')}.hide();"/>
          • 2. Re: How to switch between modelPanels
            Ilya Shaikovsky Master

            <button onclick="#{...('one')}.hide; #{...'another'}.show()";/>




            1)  #{rich:component('myModelPanel')}.hide()

            usage of JS in handler


            2) Richfaces.hideModalPanel('myModalPanel')



            3) using <rich:componentControl>

            declarative definition with tag.


            1) and 3) actually generate the same call. It's just the question of convinience.