tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Callender (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (TAP5-2297) Grid needs a context to properly participate in AJAX pages
Date Mon, 04 Jan 2016 09:37:39 GMT

     [ https://issues.apache.org/jira/browse/TAP5-2297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Geoff Callender updated TAP5-2297:
----------------------------------
    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 preview-34: 
        http://jumpstart.doublenegative.com.au/jumpstart7/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.


  was:
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 preview-6: 
        http://jumpstart.doublenegative.com.au/jumpstart7/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.



> Grid needs a context to properly participate in AJAX pages
> ----------------------------------------------------------
>
>                 Key: TAP5-2297
>                 URL: https://issues.apache.org/jira/browse/TAP5-2297
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.4
>            Reporter: Geoff Callender
>              Labels: easyfix
>
> 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 preview-34: 
>         http://jumpstart.doublenegative.com.au/jumpstart7/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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message