Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1870

javascript added while in the render phase of a component from an ajax request is never executed

    XMLWordPrintableJSON

Details

    Description

      When a zone update occurs, the 'setupRender' is called for each component contained by that zone.

      If a script is added to ajaxResponseRenderer within the 'setupRender' method it is never executed on the page.

      eg:

      public class MyPage
      {
      void onSomeEvent()

      { ajaxResponseRenderer.addRender(myZone); // myZone contains a MyComponent in the tml }

      }

      public class MyComponent
      {
      void setupRender()
      {
      if (request.isXHR())
      ajaxResponseRenderer.addCallback(new JavaScriptCallback() { public void run(JavaScriptSupport javascriptSupport) {
      javascriptSupport.addScript("alert('here');");}});
      }
      }

      Attachments

        Issue Links

          Activity

            People

              hlship Howard Lewis Ship
              paul.stanton Paul Stanton
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: