Timtech4u / gwtquery

Automatically exported from code.google.com/p/gwtquery
MIT License
0 stars 0 forks source link

binding an event to GQuery.window throws exception #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Write code to bind onfocus to GQuery.window:

        $(GQuery.window).focus(new Function() {
            @Override public void f() {
                Window.alert("bind occurred");
            }
        });

What is the expected output? What do you see instead?
Like jQuery, GQuery should add the onfocus event listener to the DOM window.

What version of the product are you using? On what operating system?
Using gwtquery 1.1.1, but the latest version shows the same problematic code in 
EventsListener#sink():

http://code.google.com/p/gwtquery/source/browse/gwtquery-core/src/main/java/com/
google/gwt/query/client/plugins/events/EventsListener.java

Please provide any additional information below.

element.getAttribute() fails on the 'window' element with the following 
exception:

com.google.gwt.core.client.JavaScriptException: (TypeError): Object doesn't 
support property or method 'getAttribute'

Perhaps #sink() should add a special case for window to avoid the call to 
element.getAttribute("tabIndex"). I don't think tabIndex is meaningful on the 
window object.

Original issue reported on code.google.com by jke...@connectwise.com on 5 Nov 2012 at 2:54

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 07263983873c.

Original comment by manuel.carrasco.m on 10 Dec 2012 at 9:00

GoogleCodeExporter commented 9 years ago

Original comment by manuel.carrasco.m on 10 Dec 2012 at 9:00