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 2008/12/29 23:13:44 UTC

[jira] Issue Comment Edited: (WICKET-1553) Pass the event to the event handler in HeaderResponse.renderOnEventJavascript

    [ https://issues.apache.org/jira/browse/WICKET-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659670#action_12659670 ] 

martin-g edited comment on WICKET-1553 at 12/29/08 2:12 PM:
-------------------------------------------------------------------

Because I need a reference to the event which triggered this callback function. My "javascript" variable contains some keyCode checks.

Also all official ways to register a callback handler for an event in Javascript provides the event itself:
- element.onclick = function(ev) {...}
- window.addEventListener('click', myCallback, false) (non-IE) and window.attachEvent('click', myCallback) (IE) will pass the event to myCallback().

I don't see a reason why Wicket should hide the event from me.

      was (Author: martin-g):
    Because I need a reference to the event which triggered this callback function. My "javascript" variable contains some keyCode checks.

Also all official ways to register a callback handler for an event in Javascript provides the event itself:
- element.onclick = function(ev) {...}
- window.addEventListener('click', myCallback, false) (non-IE) and window.attachEvent('click', myCallback) (IE) will pass the event to myCallback().

I don't a reason why Wicket should hide the event from me.
  
> Pass the event to the event handler in HeaderResponse.renderOnEventJavascript 
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1553
>                 URL: https://issues.apache.org/jira/browse/WICKET-1553
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.2
>         Environment: Any
>            Reporter: Martin Grigorov
>            Assignee: Matej Knopp
>            Priority: Trivial
>
> Index: wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java
> ===================================================================
> --- wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java        (revision 648178)
> +++ wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HeaderResponse.java        (working copy)
> @@ -312,7 +312,7 @@
>                         {
>                                 renderJavascriptReference(WicketEventReference.INSTANCE);
>                                 JavascriptUtils.writeJavascript(getResponse(), "Wicket.Event.add(" + target +
> -                                       ", \"" + event + "\", function() { " + javascript + ";});");
> +                                       ", \"" + event + "\", function(event) { " + javascript + ";});");
>                                 markRendered(token);
>                         }
>                 }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.