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

Grid needs a context to properly participate in AJAX pages

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.3, 5.4
    • None
    • tapestry-core

    Description

      This is a request to bring Grid into line with Form, EventLink, and ActionLink. They have a context parameter, which is very useful when in a component that is nested deeply in an AJAX page. In such situations, there may be no way to use the page's context to restore the component's parameters, ie. its context. The way out is to use the Form's, EventLink's, or ActionLink's context. Eg.

      @Parameter
      private Integer verySpecificId;

      public void onPrepareForSubmit(Integer verySpecificId)

      { this. verySpecificId = verySpecificId; }

      However, Grid doesn't yet have a context parameter, so no context can be passed when a pager link or column sorting link is clicked. So an inplace request from a GridPager or column sort link can't remind its containing component of what was
      currently selected, how the Grid was being filtered, or what the containing component's parameters were. So how can the Grid be rendered correctly?

      To solve this for GridPager, I've produced an example in which I've created a GridWithContext to wrap a Grid, and modified GridPager to include the context in its links and bubble up a new event with the context. It's in JumpStart 7.0.5:

      http://jumpstart.doublenegative.com.au/jumpstart/together/ajaxcomponentscrud/persons

      Without this, we'd lose the selectedPersonId when a GridPager link is clicked. But with it, when you reach the right page the selected person is still highlighted.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              geoffcallender Geoff Callender
              Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: