Hi Sven,
Thanks for your reply.
Here is a 12 second recording for the described scenario:
https://www.youtube.com/watch?v=_iL9DeChORU
It shows that the page is re-rendered after the reload but due to the
page version with outdated data for the order status. When the page
version is removed, it picks up the new data from the database an
everything is fine.
Here is an extract of the relevant Wicket code for this scenario:
https://gist.github.com/jmewes/d0fece6d52b3d35743e9952294aba143#file-laborderpanel-java-L45-L49
After reading the discussion thread related to Martin's
"single-page-instance" repository, I came to the conclusion that it is
not possible to disable this behavior without providing a custom
"MountedMapper" which feels too difficult for me.
Kind regards,
Jan
Am 04.01.20 um 17:46 schrieb Sven Meier:
Hi Jan,
>Given a table which displays the state of laboratory orders,
>When an order is canceled via a click on an AJAX button,
>And the page is reloaded via Ctrl + R,
>Then the order is again displayed with status "open".
the page is re-rendered on each reload. So there's no reason why the
status should be shown "open" again.
Except your code keeps hold of stale information.
Furthermore Wicket pages are never cached by the browser (maybe this
was different in 2010?).
So we could discuss page versioning, but maybe we could first check
what problem you're actually trying to solve.
Regards
Sven
On 04.01.20 16:58, Jan Mewes wrote:
Hi,
Given a table which displays the state of laboratory orders,
When an order is canceled via a click on an AJAX button,
And the page is reloaded via Ctrl + R,
Then the order is again displayed with status "open".
I am concerned that this sort of behavior could lead to error states.
I would feel better if there would not be any way to get back to the
old state, i.e. that the ?pageId in the url should be removed for
pages using AJAX.
I tried to achieve this in the following ways but failed:
Disable the versioning by calling the
method/Page#//setVersioned(false):/
https://ci.apache.org/projects/wicket/guide/8.x/single.html#_turning_off_page_versioning
Providing a custom "MountedMapper" as show here and mentioned in the
corresponding conversation:
https://github.com/martin-g/single-page-instance
Setting cache control headers to force a page reload:
https://www.richardnichols.net/2010/03/apache-wicket-force-page-reload-to-fix-ajax-back/
Is there any chance that the disabling of page versioning could
become a first-class feature?
Kind regards,
Jan