Timtech4u / gwtquery

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

NPE in dispatchEvent when using GwtChosen #178

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey there,

i found a NPE in EventsListener.dispatchEvent(Event). it also could be related 
to GwtGhosen so i also created a ticket there.

i made a small project where you can see the bug. you can get the rar file here 
http://s000.tinyupload.com/?file_id=43582344205645255315 or use the attached 
file.

how to reproduce the issue:
1) select any value in box 1
2) select any value in box 2 (DO NOT click any where else than on box 2)
3) after selecting a value in box 2 you should see both boxes with a blue 
border (blur event seems buggy)
4) click on the button*. you will get the alert and after you click ok, you get 
the NPE
*) you can also click anywhere else to get the exception...

It seems that the *what ever you click* element gets a "click" event in GQuerys 
EventListener and the elementEvents List contains only 1 entry wich is null. ( 
http://code.google.com/p/gwtquery/source/browse/gwtquery-core/src/main/java/com/
google/gwt/query/client/plugins/events/EventsListener.java#549 )

Tested with:
GWT: 2.5.0
GQuery: 1.3.2
GwtChosen: 1.1.0-alpha-2

Browser:
Firefox: 17.0.5 (ESR)
Internet Explorer: 8 (8.0.6001.1872)
Chrome: 26 (26.0.1410.64 m)

OS: WinXP SP3

Here is the Link to the gwtchosen ticket 
https://github.com/jDramaix/gwtchosen/issues/77 

Original issue reported on code.google.com by kujans...@gmail.com on 15 Apr 2013 at 8:46

Attachments:

GoogleCodeExporter commented 9 years ago
can't find an edit button.

simple work around:

check for "listener != null" before testing "listener.hasEventType(etype)"

Original comment by kujans...@gmail.com on 15 Apr 2013 at 8:49

GoogleCodeExporter commented 9 years ago
Julien, please could you take a look?

- Manolo

Original comment by manuel.carrasco.m on 21 Apr 2013 at 5:33

GoogleCodeExporter commented 9 years ago
yep sure

Original comment by julien.d...@gmail.com on 22 Apr 2013 at 9:32

GoogleCodeExporter commented 9 years ago
any news on this?

Original comment by kujans...@gmail.com on 8 May 2013 at 6:05

GoogleCodeExporter commented 9 years ago
will look at that next week

Original comment by julien.d...@gmail.com on 8 May 2013 at 8:11

GoogleCodeExporter commented 9 years ago
don't want to bug you, but i would like to know if there is any progress.

Original comment by kujans...@gmail.com on 5 Jun 2013 at 7:22

GoogleCodeExporter commented 9 years ago
The problem is mainly in GwtChosen. 
As you are two GwtChosen component each of them add a click event handler to 
the body element. When the clicks occurs, GQuery iterates on these two handlers 
and execute them. The problem is that the first handler remove the second and 
so when GQuery try to execute the second, it doesn't exist anymore.

I will fix GQuery to avoid this behavior (if the handler is null do nothing) 
But I have also to fix GwtChosen to avoid that the first handler removes the 
second (it should only removes itself)

Thansk for bug reporting !

Original comment by julien.d...@gmail.com on 7 Jun 2013 at 1:24

GoogleCodeExporter commented 9 years ago
see https://github.com/gwtquery/gwtquery/pull/30

Original comment by julien.d...@gmail.com on 7 Jun 2013 at 1:55

GoogleCodeExporter commented 9 years ago

Original comment by julien.d...@gmail.com on 15 Jul 2013 at 4:03

GoogleCodeExporter commented 9 years ago
Is this fix in version 1.3.3? The code in dispatchEvent looks unchanged to me 
in the current release version.

Original comment by csbb...@gmail.com on 2 Sep 2013 at 4:02

GoogleCodeExporter commented 9 years ago
Are there any news about this ? Best !

Original comment by Pericles...@gmail.com on 3 Dec 2013 at 7:23

GoogleCodeExporter commented 9 years ago
it's fixed in 1.4-SNAPSHOT. The 1.4 should be released next week. Please 
continue discussion on https://github.com/gwtquery/gwtquery/pull/30

Original comment by julien.d...@gmail.com on 3 Dec 2013 at 7:30