1 Reply Latest reply on Apr 12, 2010 12:33 PM by nbelaevski

    displaying ModalPanel without refreshing the page

    orkun

      hello

       

      I constructed ModalPanel in javaBean.

       

      and added

       

      myPanel1.setKeepVisualState(true);

      myPanel1.setShowWhenRendered(true);

       

      But It ModalPanel displays untill I refresh the page with

      <excontext.redirect("http://localhost:8080/pro1/bir.jsf") > and it slows the application

       

      But is there any way to display myPanel1  without refreshing the page using javabean ?

       

       

      regards

        • 1. Re: displaying ModalPanel without refreshing the page
          nbelaevski

          Hi,

           

          Yes, you can show it via client-side API. Two possible options to deliver script to the client in AJAX request:

           

          1. Pass script text into AjaxContext#setOncomplete (this will overwrite previously-defined script)

          2. Place inline script code on the page and re-render this part, e.g.:

           

          <a4j:outputPanel ajaxRendered="true">
               <span>
                    <script type="text/javascript">
                    //...script body
                    </script>
               </span>
          </a4j:outputPanel>
           
          
          

           

          As far as I remember, photoalbum demo application uses the second approach.