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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          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:

              Slack

                Issue deployment