You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/11/03 14:52:34 UTC
[jira] [Updated] (WICKET-5744) Multiple
AjaxSelfUpdatingTimerBehaviour objects conflict with each other
[ https://issues.apache.org/jira/browse/WICKET-5744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov updated WICKET-5744:
------------------------------------
Attachment: 5744.tgz
5744.tgz - a quickstart that works!
> Multiple AjaxSelfUpdatingTimerBehaviour objects conflict with each other
> ------------------------------------------------------------------------
>
> Key: WICKET-5744
> URL: https://issues.apache.org/jira/browse/WICKET-5744
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.16.0
> Environment: JDK7, JRE8
> Reporter: Michaƫl Benjamin Saerens
> Assignee: Martin Grigorov
> Priority: Minor
> Attachments: 5744.tgz
>
>
> When multiple AjaxSelfUpdatingTimerBehaviour objects are created on a single page, one of them will outrule all the others.
> 2014-10-31 11:46:29,058 DEBUG [FiberBranchViewPage] Creating CollectionUpdater: [ProgressInfoPanel [Component id = collectionStatus]]
> 2014-10-31 11:46:29,063 DEBUG [FiberBranchViewPage] Creating ServiceDiagnosisUpdater: [ProgressInfoPanel [Component id = serviceDiagnosisStatus]]
> 2014-10-31 11:46:31,460 DEBUG [FiberBranchViewPage] CollectionUpdater post process target: [AjaxRequestHandler@1701777932 responseObject [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]
> 2014-10-31 11:46:31,486 DEBUG [FiberBranchViewPage] CollectionUpdater FiberBranchViewPage$12@184acf6 interval set: 3 seconds
> 2014-10-31 11:46:31,547 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater post process target: [AjaxRequestHandler@1701777932 responseObject [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]
> 2014-10-31 11:46:31,570 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater FiberBranchViewPage$14@d44e89 interval set: 3 seconds
> 2014-10-31 11:46:34,749 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater post process target: [AjaxRequestHandler@1701777932 responseObject [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]
> 2014-10-31 11:46:34,766 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater FiberBranchViewPage$14@d44e89 interval set: 3 seconds
> 2014-10-31 11:46:37,937 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater post process target: [AjaxRequestHandler@1701777932 responseObject [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]
> 2014-10-31 11:46:37,967 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater FiberBranchViewPage$14@d44e89 interval set: 3 seconds
> 2014-10-31 11:46:41,148 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater post process target: [AjaxRequestHandler@1701777932 responseObject [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]
> 2014-10-31 11:46:41,179 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater FiberBranchViewPage$14@d44e89 interval set: 3 seconds
> 2014-10-31 11:46:44,382 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater post process target: [AjaxRequestHandler@1701777932 responseObject [org.apache.wicket.ajax.AjaxRequestHandler$1@3e1]
> 2014-10-31 11:46:44,407 DEBUG [FiberBranchViewPage] ServiceDiagnosisUpdater stopped: FiberBranchViewPage$14@d44e89
> {code:title=FiberBranchViewPage.java}
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.panel.Panel;
> public class FiberBranchViewPage extends WebPage {
> public static final Duration FAST_REFRESH_INTERVAL = Duration.milliseconds(100);
> public static final Duration NORMAL_REFRESH_INTERVAL = Duration.seconds(3);
> private Panel collectionStatus;
> private Panel serviceDiagnosisStatus;
> public FiberBranchViewPage(PageParameters parameters) {
> super(parameters);
> addOrReplace(collectionStatus);
> addOrReplace(serviceDiagnosisStatus);
> if (!isLiveCollectionFinished()) {
> createCollectionUpdater();
> }
> if (!isVlanCollectionFinished()) {
> createServiceDiagnosisUpdater();
> }
> }
> private void createCollectionUpdater() {
> log.debug("Creating CollectionUpdater: {}", collectionStatus);
> final AjaxSelfUpdatingTimerBehavior ajaxSelfUpdatingTimerBehavior = new AjaxSelfUpdatingTimerBehavior (FAST_REFRESH_INTERVAL) {
> @Override
> protected void onPostProcessTarget(AjaxRequestTarget target) {
> log.debug("CollectionUpdater post process target: {}", target);
> super.onPostProcessTarget(target);
> if (isLiveCollectionFinished()) {
> this.stop(target);
> log.debug("CollectionUpdater stopped: {}", this);
> } else {
> this.setUpdateInterval(NORMAL_REFRESH_INTERVAL);
> log.debug("CollectionUpdater {} interval set: {}", this, NORMAL_REFRESH_INTERVAL);
> }
> }
> };
> collectionStatus.add(ajaxSelfUpdatingTimerBehavior);
> }
> private void createServiceDiagnosisUpdater() {
> log.debug("Creating ServiceDiagnosisUpdater: {}", serviceDiagnosisStatus);
> final AjaxSelfUpdatingTimerBehavior ajaxSelfUpdatingTimerBehavior = new AjaxSelfUpdatingTimerBehavior (FAST_REFRESH_INTERVAL) {
> @Override
> protected void onPostProcessTarget(AjaxRequestTarget target) {
> log.debug("ServiceDiagnosisUpdater post process target: {}", target);
> super.onPostProcessTarget(target);
> if (getModel().isVlanCollectionFinished()) {
> this.stop(target);
> log.debug("ServiceDiagnosisUpdater stopped: {}", this);
> } else {
> this.setUpdateInterval(NORMAL_REFRESH_INTERVAL);
> log.debug("ServiceDiagnosisUpdater {} interval set: {}", this, NORMAL_REFRESH_INTERVAL);
> }
> }
> };
> serviceDiagnosisStatus.add(ajaxSelfUpdatingTimerBehavior);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)