WICKET-3367 Rewrite all JavaScript inline event handlers to be proper attached event handlers
Remove the override of postprocessAttributes(). 'domready' is the default event. There is no need to transfer it to the client side. Fire the event when the component on which the behavior is attach is 'domready', not on the window. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/fa18e137 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/fa18e137 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/fa18e137 Branch: refs/heads/master Commit: fa18e137a6d180e162763c7b17a0a55d3482243a Parents: bcc1930 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Wed Jan 18 09:34:50 2012 +0100 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Wed Jan 18 09:35:13 2012 +0100 ---------------------------------------------------------------------- .../wicket/ajax/AbstractAjaxTimerBehavior.java | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/fa18e137/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java index e6fd084..27b5f7f 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java @@ -85,7 +85,7 @@ public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehav { super.renderHead(component, response); - WebRequest request = (WebRequest)RequestCycle.get().getRequest(); + WebRequest request = (WebRequest) component.getRequest(); if (!isStopped() && (!headRendered || !request.isAjax())) { @@ -94,16 +94,6 @@ public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehav } } - @Override - protected void postprocessConfiguration(JSONObject attributes, Component component) - throws JSONException - { - super.postprocessConfiguration(attributes, component); - - attributes.remove("c"); // window will be used - attributes.put("e", "domready"); - } - /** * @param updateInterval * Duration between AJAX callbacks @@ -123,7 +113,7 @@ public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehav * @return the name of the handle that is used to stop any scheduled timer */ private String getTimeoutHandle() { - return "Wicket.timeoutHandle_"+getComponent().getMarkupId(); + return "Wicket.timerHandle_"+getComponent().getMarkupId(); } /**
