Tapestry 5
  1. Tapestry 5
  2. TAP5-1100

On ajax request, template body doesn't render if page is new in pagepool or if server restarted


    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s:
    • Fix Version/s: 5.2.0
    • Component/s: tapestry-core
    • Labels:


      Bug process :

      • Write a component using ajax form and a <t:body />. When form is submitted in ajax, the component renders its body.
      • Start jetty, open the page
      • Restart jetty, submit the ajax form
        -> The form is refreshed without the body of the component

      Attached to the ticket, a little project showing the problem (just open the index page and click submit)

      The problem is in ComponentPageElementImpl, the beforeRenderBodyPhase should be called for the part of Index template inside my component, but as the page has never been rendered before, beforeRenderBodyPhase is null.

      We have the same issue if a new page instance is created to treat the ajax request. If the page is taken from the page pool, then there is no problem as the page has already been initialized.

      A patch that could fix it (didn't test it) :

      Index: src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
      — src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java (revision 931530)
      +++ src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java (working copy)
      @@ -834,7 +834,9 @@
      public void enqueueBeforeRenderBody(RenderQueue queue)

      { // If no body, then no beforeRenderBody or afterRenderBody - + if(! renderPhasesInitalized) + initializeRenderPhases(); + if (bodyBlock != null) push(queue, beforeRenderBodyPhase); }
      1. ajaxbody.zip
        52 kB
        Denis Delangle


        Denis Delangle created issue -
        Denis Delangle added a comment -

        Little tapestry 5 project created from archetype demonstrating the bug (index page)

        Denis Delangle added a comment - Little tapestry 5 project created from archetype demonstrating the bug (index page)
        Denis Delangle made changes -
        Field Original Value New Value
        Attachment ajaxbody.zip [ 12441033 ]
        Howard M. Lewis Ship made changes -
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.2.0 [ 12314122 ]
        Resolution Fixed [ 1 ]


          • Assignee:
            Howard M. Lewis Ship
            Denis Delangle
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: