3 Replies Latest reply on Feb 10, 2009 3:40 PM by fmarwede

    Is there a way to trigger a rerender from JavaScript?

      Is there a way to trigger a rerender programatically from JavaScript?

      Regards,

        • 1. Re: Is there a way to trigger a rerender from JavaScript?

          a4j:jsFunction

          • 2. Re: Is there a way to trigger a rerender from JavaScript?

             

            "SergeySmirnov" wrote:
            a4j:jsFunction


            yes but, that forces me to call a function in the java side... what if I want to trigger a rerender but without calling a function on the java side?

            For example:

            1.-In OrderList.xhtml the user opens a modalPanel that ui:includes CustomerList.xhtml, he searches a Customer in the modalPanel, and clicks the "Choose Customer" that appears in one of the columns, that link calls a "wiring" method that links that Customer object with the Order that will be used to make a "Query by Example".

            2.- The modalPanel that ui:includes CustomerList.xhtml is closed by click in the link, and on its onhide event it should rerender an outputText in OrderList.xhtml with this expression: #{orderListHome.order.customer.name}.

            Currently what i do is that I put the output inside an a:outputPanel with ajaxRendered="true", but I would like to be able to be more specific and rerender a particular a:outputPanel by referencing its Id.


            AFAIK a4j:jsFunction does not work for me because I no longer need to call a function on the server, the server already has the information I need to display stored in either the PAGE or the CONVERSATION scope, all that I want is to have a portion of the page rerendered.


            • 3. Re: Is there a way to trigger a rerender from JavaScript?

              You don't have to call java code with jsFunction. What about:

              <a4j:jsFunction name="reRenderSomething" reRender="someId" />
              


              And in the definition of the modalPanel

              
               <rich:modalPanel ... onhide="reRenderSomething()"
              ...
               </rich:modalPanel>