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

Martin Grigorov commented on WICKET-1553:
-----------------------------------------

No, the variable 'event' is for example: 'click', 'keydown', ...
In my patch 'event' is just part of the constructed string for the callback 
function.
Rename it to 'jsEvent' if you think it will be less confusing.
For example the produced JavaScript could be:

function(jsEvent) {
   if (jsEvent.keyCode === 13) {
      processEnterKey();
   }
}

Here the body of the function (the IF statement + its body) is the value of 
'javascript' variable.

> 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.

Reply via email to