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/04/19 14:02:21 UTC

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

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


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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659670#action_12659670 ] 

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

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.


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

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659693#action_12659693 ] 

Juergen Donnerstag commented on WICKET-1553:
--------------------------------------------

But I don't get the patch you provided. What do you expect event to contain? Shouldn't it be rather
+ ", \"" + event + "\", function(\""+event+"\") { " + javascript + ";});"); 

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


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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Juergen Donnerstag resolved WICKET-1553.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-RC2
         Assignee: Juergen Donnerstag  (was: Matej Knopp)

fixed

> 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: Juergen Donnerstag
>            Priority: Trivial
>             Fix For: 1.4-RC2
>
>
> 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.


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

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659565#action_12659565 ] 

Juergen Donnerstag commented on WICKET-1553:
--------------------------------------------

why is that needed?

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


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

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1553:
-------------------------------------

    Assignee: Matej Knopp

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


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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ 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.