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

    How to switch between modelPanels

    blaverman

      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

       

      PS

      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
          sivaprasad9394

          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"
          immediate="true"
          oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('modelPanelId')}.hide();"/>
          • 2. Re: How to switch between modelPanels
            ilya_shaikovsky

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

             

             

            P.S.

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

            usage of JS in handler

             

            2) Richfaces.hideModalPanel('myModalPanel')

            deprecated.

             

            3) using <rich:componentControl>

            declarative definition with tag.

             

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