Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Targeting Click release 0.21

      Description

      Add a Page onRender() method which is invoked immediately after the onPost() or onGet() method is executed (if page controls have allowed processing to continue).

      ClickServlet processPage() method:
      ..

      if (continueProcessing) {
      if (isPost)

      { page.onPost(); }

      else

      { page.onGet(); }

      page.onRender();
      }

      ..

      ---------------------------------------------------------

      From Stephen's "click hacks" email:

      5. onRender event hook

      For just before the template is rendered, to do interesting stuff like
      throwing in some tools into our model, hook up Links (see next point), etc.

      Otherwise we had people having both doGet/doPost, and just having doPost
      call doGet, when all they were doing was some pre-render logic.

        Activity

        Stephen Haberman created issue -
        Hide
        Stephen Haberman added a comment -

        Our "onRender" is called only if a velocity template is going to be rendered, e.g. as the first part of renderTemplate (or right before renderTemplate is called, if you want to keep the events all called from the processPage() method--don't have the source in front of me).

        This way we can skip executing potentially complex/expensive rendering setup logic if the page is just responding with an HTTP redirect.

        Show
        Stephen Haberman added a comment - Our "onRender" is called only if a velocity template is going to be rendered, e.g. as the first part of renderTemplate (or right before renderTemplate is called, if you want to keep the events all called from the processPage() method--don't have the source in front of me). This way we can skip executing potentially complex/expensive rendering setup logic if the page is just responding with an HTTP redirect.
        Hide
        Malcolm Edgar added a comment -

        Hi Stephen,

        I give this some thought, as I too dont want any expensive processing performed if its is a forward or a redirect.

        Click also supports JSP pages which are always forwarded to, and for these pages the onRender() method is also important. While an additional switch could be added on the forward section, this makes the code more complex and difficult to describe.

        The approach above should work well, as most of the time Controls will abort continued processing and set a render or forward target.

        If I have got this wrong please tell me.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Hi Stephen, I give this some thought, as I too dont want any expensive processing performed if its is a forward or a redirect. Click also supports JSP pages which are always forwarded to, and for these pages the onRender() method is also important. While an additional switch could be added on the forward section, this makes the code more complex and difficult to describe. The approach above should work well, as most of the time Controls will abort continued processing and set a render or forward target. If I have got this wrong please tell me. regards Malcolm Edgar
        Malcolm Edgar made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Malcolm Edgar added a comment -

        Checked into SVN. Will be available in release 0.21

        Show
        Malcolm Edgar added a comment - Checked into SVN. Will be available in release 0.21
        Malcolm Edgar made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Malcolm Edgar made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Project Import Fri Mar 20 14:11:32 PDT 2009 [ 1237583492744 ]

          People

          • Assignee:
            Malcolm Edgar
            Reporter:
            Stephen Haberman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development