[
https://issues.apache.org/jira/browse/WICKET-4939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537782#comment-13537782
]
Jonas commented on WICKET-4939:
-------------------------------
Or even more simple
private boolean shouldTrigger()
{
return isStopped() == false &&
isEnabled(getComponent()) &&
getComponent().findPage() != null;
}
Unless, of course, there's a particular reason why a WEBpage parent is needed
and some other Page wouldn't be ok as well...
> AbstractAjaxTimerBehavior never triggers if attached to WebPage
> ---------------------------------------------------------------
>
> Key: WICKET-4939
> URL: https://issues.apache.org/jira/browse/WICKET-4939
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.4.0
> Reporter: Jonas
> Priority: Minor
>
> Since WICKET-4886 was fixed, AbstractAjaxTimerBehavior never triggers anymore
> if it is added the the page itself.
> See: org.apache.wicket.ajax.AbstractAjaxTimerBehavior.shouldTrigger()
> getComponent().findParent(WebPage.class) != null
> is always false in that case, which seems to be wrong. It should also be ok
> if the component itself is the WebPage.
> So, the method should probably read something like
> private boolean shouldTrigger()
> {
> return isStopped() == false &&
> isEnabled(getComponent()) &&
> (getComponent().findParent(WebPage.class) !=
> null || getComponent() instanceof WebPage);
> }
> Temporary workaround:
> add the AbstractAjaxTimerBehavior to a subcomponent of the page instead.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira