3 Replies Latest reply on Nov 5, 2009 9:55 AM by ahoehma

    How can i reload an <a4j:outputPanel>

    karam

      Hi,
      is it possible to reRender an outputPanel after it is loading?

      For example...

      <a4j:outputPanel id="myPanel">
       <a4j:support event="oncomplete" action="#{someBean.action}" reRender="myPanel">
      </a4j:outputPanel>
      


        • 1. Re: How can i reload an <a4j:outputPanel>
          ilya_shaikovsky

          add handler to page load event (e.g. using jQuery) and call jsFunction. Or if the request is ajax one - use oncomplete to send the second one with the same jsFunction.

          • 2. Re: How can i reload an <a4j:outputPanel>
            karam

            can you give me a small example?

            i have no idea how to do it

            • 3. Re: How can i reload an <a4j:outputPanel>
              ahoehma

               

              <a4j:outputPanel id="foobar">
              Hello World
              </a4j:outputPanel>
              <a4j:jsFunction name="reRenderFoobar" reRender="foobar"/>
              


              #1 jQuery on page load:
              <a4j:loadScript src="resource:///org/richfaces/renderkit/html/scripts/jquery/jquery.js" />
              
               <script type="text/javascript">
               jQuery(document).ready(function(){
               // call a4j:jsFunction to rerender outputpanel ...
               reRenderFoobar();
               });
               </script>
              


              #2 richfaces ajax:
              <a4j:commandLink value="action and rerender" reRender="foobar"/>