GitHub user dashorst opened a pull request:
https://github.com/apache/wicket/pull/151
WICKET-6055 Made AjaxLazyLoadPanel non-blocking
When having multiple AjaxLazyLoadPanels on your page, they all block
their Wicket request thread until the content is ready to load. This
can be problematic when you try to wait for some background job to
finish and want to poll for that job to be ready, and only then update
the contents.
The improvement would be to add a method that gives the developer the
option to not update just yet (isReadyForReplacement) and when it
returns true, start the replacement. By default this would return true,
implementing the current behavior of the AjaxLazyLoadPanel.
Furthermore to improve the responsiveness of the ALLP it should add a
single timer to the page that can be used by multiple ALLPs to update
themselves. The timer would poll each second and the ALLPs would use
Wicket's event bus to update themselves. With some reference counting,
the timer can remove itself from the page when all ALLPs have updated
themselves.
This enables refreshing the page as well when outside an AJAX context,
or having a user be impatient and pressing F5.
Fixes WICKET-6055
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dashorst/wicket WICKET-6055
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/wicket/pull/151.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #151
----
commit 73ed63dac6e4426c843b4826406fab1984264d9d
Author: Martijn Dashorst <[email protected]>
Date: 2015-12-23T20:16:43Z
WICKET-6055 Made AjaxLazyLoadPanel non-blocking
When having multiple AjaxLazyLoadPanels on your page, they all block
their Wicket request thread until the content is ready to load. This
can be problematic when you try to wait for some background job to
finish and want to poll for that job to be ready, and only then update
the contents.
The improvement would be to add a method that gives the developer the
option to not update just yet (isReadyForReplacement) and when it
returns true, start the replacement. By default this would return true,
implementing the current behavior of the AjaxLazyLoadPanel.
Furthermore to improve the responsiveness of the ALLP it should add a
single timer to the page that can be used by multiple ALLPs to update
themselves. The timer would poll each second and the ALLPs would use
Wicket's event bus to update themselves. With some reference counting,
the timer can remove itself from the page when all ALLPs have updated
themselves.
This enables refreshing the page as well when outside an AJAX context,
or having a user be impatient and pressing F5.
Fixes WICKET-6055
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---