2 Replies Latest reply on Apr 15, 2008 11:33 AM by Daniel Wachter

    Reload View on method call

    Daniel Wachter Newbie

      Hello Together


      I have a view of Objects, which I can edit via a link that opens a popup window.


      Is it possible to reload the view of objects if I for example add some notes via an method call of the popup window?


      Or is the only way to work with a a4j:poll component?


      Regards Daniel

        • 1. Re: Reload View on method call
          James Kelly Newbie

          Rather than polling on the page that opens the pop-up, I've added a a4j:jsFunction to the main page and then called it from the pop-up via plain-old javascript.


          For example,


          <script>
          function notifyParent(){
            window.opener.yourJSFucntion();
          }
          </script>
          



          Assign an oncomplete method to the jsFunction which actually closes your pop-up. This will ensure 1) yourJSFunction gets called and 2) the data on the opening page is updated before your pop-up closes.

          • 2. Re: Reload View on method call
            Daniel Wachter Newbie

            Hello James


            Thank you for your hint.


            Is it possible to trigger the edit function for completing before call the javascript. Sometimes I have the problem, that the update in the db isn't already inserted if the javascript for reload is called.


            I can add a timeout, but I think there must be a better way!
            Or can I call a refresh from the backin bean?


            Greetings




            ps: I make the refresh via

            window.opener.location.reload();


            so i don't need a a4j:jsfunction on the main screen