You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (Reopened) (JIRA)" <ji...@apache.org> on 2012/04/12 21:47:27 UTC

[jira] [Reopened] (WICKET-4286) ListView causes page ID increment

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

Igor Vaynberg reopened WICKET-4286:
-----------------------------------


a valid usecase:

whats happening is this

user hits the page /foo
goes to /foo?1
does a bunch of ajax stuff, staying on /foo?1
clicks refresh, so hits /foo?1
listview refreshes, changing hierarchy, creating page version 2
the ajax behavior's url is rendered as /foo?2:...
the page is rendered, but not redirected to /foo?2

so what we have now is a browser pointing to /foo?1 and ajax (and
non-ajax) urls pointing to /foo?2

further clicks work only because the component they repaint has the
same markup id on page 1 and page 2. however, all model changes are
stored in page 2. this is why when the browser is refreshed the
counter reverts to a previous value - because it is page 1 that is
rerendered.

there are two ways to fix this:

1) redirect to correct version. so when the browser is refreshed for
the first time on /foo?1 the browser would redirect to /foo?2 and it
would keep doing that for every refresh. not ideal.

2) freeze the page version when we are accessing a url that we know
will not mutate the state of the page - meaning urls that just render
the page and do not invoke any listeners. the only state we will lose
is noise from component replacement in listviews and user's
onbeforerender() overrides which i think is acceptable since they do
not represent true state mutation that comes from intentional
callbacks.

                
> ListView causes page ID increment
> ---------------------------------
>
>                 Key: WICKET-4286
>                 URL: https://issues.apache.org/jira/browse/WICKET-4286
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: any
>            Reporter: Mark Lichtenberg
>            Assignee: Igor Vaynberg
>         Attachments: ajaxtest1.5.3.tar.gz
>
>
> A ListView with setReuseItems(false) causes the page ID to increment when the page is reloaded or the back button is pressed. This new ID is not reflected in the URL so Ajax actions against the new ID are lost when navigating away and back again. 
> Steps to reproduce in quickstart
> 1) Load quickstart project in browser
> 2) Click "Link to Other" then click browser's back button.
> 3) Notice the log statement indicates the HomePage ID is 2, yet the URL remains at ID 0
> 4) Click "Ajax Increment Link" a few times
> 5) Click "Link to Other" then click browser's back button
> 6) Notice the counter is at zero, and subsequent clicks to the "Ajax Increment Link" start from zero. The current page ID output in the log is 4.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira