My favorites | Sign in
GWT
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 4584: Auto-hide code in PopupPanel can fail if no history iframe is present
11 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  jlaba...@google.com
Closed:  Feb 2010
Cc:  jgw@google.com, mmendez@google.com


Sign in to add a comment
 
Reported by Konstant...@gmail.com, Feb 4, 2010
(If this is your first time submitting an issue report to the GWT Issue
Tracker, please see the sample issue report linked below for an example of
a well reported issue)
Sample issue report:
https://code.google.com/p/google-web-toolkit/wiki/IssueReportSample


Found in GWT Release (e.g. 1.5.3, 1.6 RC): 2.0.1



Encountered on OS / Browser (e.g. WinXP, IE6-7, FF3): Vista x64, IE7



Detailed description (please be as specific as possible):

  Try to use DialogBox.show() when module has no "__gwt_historyFrame" frame.
  Same code works in GWT 2.0.0.


00:02:53,893 [ERROR] Uncaught exception escaped
java.lang.NullPointerException: null 	at
com.google.gwt.user.client.History.addValueChangeHandler(History.java:96) 
at
com.google.gwt.user.client.ui.PopupPanel.setState(PopupPanel.java:1387) 	at
com.google.gwt.user.client.ui.PopupPanel.show(PopupPanel.java:969) 	at
com.google.gwt.user.client.ui.DialogBox.show(DialogBox.java:347) 	at
com.mycompany.project.client.ImageViewer$1.onClick(ImageViewer.java:21) 	at
com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54) 	at
com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1) 	at
com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
	at
com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
	at
com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
	at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:52) 	at
com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116) 	at
com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:100) 	at
com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1307) 	at
com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1263) 	at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597) 	at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) 	at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
	at
com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
	at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
	at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
	at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507) 	at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
	at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
	at com.google.gwt.core.client.impl.Impl.apply(Impl.java) 	at
com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188) 	at
sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597) 	at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) 	at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) 	at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
	at
com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
	at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
	at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
	at java.lang.Thread.run(Thread.java:619)



Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):



Workaround if you have one:



Links to relevant GWT Developer Forum posts:

Feb 5, 2010
Project Member #1 jgw@google.com
This report could be a little clearer, but in a nutshell the PopupPanel code assumes 
that History will always be supported. This is not strictly true, because in the 
absence of a history iframe, IE cannot support history events, and will generate this 
error if you attempt to use them (there's a warning about it in hosted mode when 
you attempt to initialize the history system).

We need the code in PopupPanel to work whether or not history is enabled. There's 
currently no way to ask this question (History.isEnabled() or something like that), so 
we'll have to add this.

gwtc discussion:
https://groups.google.com/group/google-web-toolkit-
contributors/browse_thread/thread/ee70e175806778bb
Summary: Auto-hide code in PopupPanel can fail if no history iframe is present
Status: Accepted
Owner: jlaba...@google.com
Cc: j...@google.com
Labels: Category-UI Priority-High Type-Defect
Feb 5, 2010
#2 david.nouls
I hope we will get a new build soon since this is a regression issue that might 
break many applications.
Feb 5, 2010
#3 jlaba...@google.com
I'll work on this immediately.

Basically, we should only add the history handler if autoHideOnHistoryEvents is 
enabled, so we avoid the static History initializer unless users opt in.  If they opt 
in without having history enabled, then the warning makes sense.

This also means that creating a PopupPanel with autoHide enabled should NOT set 
autoHideOnHistoryEvents to true automatically.
Feb 5, 2010
#4 david.nouls
Wouldn't it be better to check if History is enabled without forcing the History 
support to be intialized ? Or alternatively it could just fail silently when the 
IFrame is not there (a warning could be useful).

IMHO: It makes a lot of sense that a auto hide popup will hide when the history 
changes without the developer having to enable an extra flag.
Feb 5, 2010
#5 itruett
From my perspective this looks like more of a problem with the IE history 
implementation than the PopupPanel's implementation. As I understand it, everywhere but 
IE the PopupPanel will add a pointless-but-harmless history handler; in IE that 
pointless handler causes an error. Wouldn't the "right" thing to do be to make the IE 
implementation more accommodating of history handlers added when history is disabled? 
Feb 5, 2010
#6 jlaba...@google.com
http://gwt-code-reviews.appspot.com/138805

The patch fixes IE history, not just PopupPanel.  We already did null checks on the 
impl instance in History, but we didn't do a null check in every method.
Status: ReviewPending
Feb 10, 2010
#7 jlaba...@google.com
committed as r7544
Status: FixedNotReleased
Feb 10, 2010
#8 jlaba...@google.com
(No comment was entered for this change.)
Labels: Milestone-2_0_2
Feb 15, 2010
#9 david.nouls
This issue is NOT fixed, this is what I get when using GWT 2.0.2
2010/02/15 14:59:20 SEVERE Unknown:Uncaught Exception
java.lang.NullPointerException
	at com.google.gwt.user.client.ui.PopupPanel.setState(PopupPanel.java:1397)
	at com.google.gwt.user.client.ui.PopupPanel.onUnload(PopupPanel.java:1025)
	at com.google.gwt.user.client.ui.Widget.onDetach(Widget.java:329)
	at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:402)
	at com.google.gwt.user.client.ui.Panel.orphan(Panel.java:210)
	at com.google.gwt.user.client.ui.ComplexPanel.remove(ComplexPanel.java:63)
	at com.google.gwt.user.client.ui.AbsolutePanel.remove(AbsolutePanel.java:159)
	at 
com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.onInstantaneousRun
(PopupPanel.java:314)
	at com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.setState
(PopupPanel.java:208)
	at com.google.gwt.user.client.ui.PopupPanel.setState(PopupPanel.java:1374)
	at com.google.gwt.user.client.ui.PopupPanel.hide(PopupPanel.java:585)
	at com.google.gwt.user.client.ui.PopupPanel.hide(PopupPanel.java:571)

Feb 15, 2010
#10 jlaba...@google.com
That was a big oversite on my part.  I added unit tests for disabling History, but I 
didn't add tests for disabling History with a PopupPanel.  I'm sure I tested it 
manually, but apparently not well enough :( 
Cc: mmen...@google.com
Labels: -Priority-High Priority-Critical
Feb 15, 2010
#11 jlaba...@google.com
(No comment was entered for this change.)
Status: Started
Feb 16, 2010
#12 jlaba...@google.com
fix committed as r7583
Status: FixedNotReleased
Feb 17, 2010
#13 olivier....@gmail.com
Although this issue is said to be fixed in GWT 2.0.2 (which is the milestone for this
filed issue), it is not included the release jars.
Feb 18, 2010
#14 david.nouls
No, it is FixedNotReleased... I am waiting for this one as well (2.0.3 ?) since it 
breaks all my apps. As a workaround I temporarily added the history IFrames, but I 
have not use for them.
Feb 18, 2010
#16 david.nouls
See comment 9. The case was re-opened because the fix was only partially working.
Feb 18, 2010
#17 jlaba...@google.com
We just uploaded a GWT 2.0.3 release candidate that fixes this issue, for real this 
time.  Please try it out and verify that the issue is indeed fixed with this version 
before we officially release it.
http://google-web-toolkit.googlecode.com/files/gwt-2.0.3.zip

This is a slightly out of band release candidate because we haven't marked the distributable as an RC.  Instead, once we receive positive feedback, we will simply 
mark it as the official release in the downloads section.

Thanks for your help,
- John
Feb 19, 2010
#18 david.nouls
John,
This one is perfect! It's a wrap!
David
Feb 19, 2010
#19 jlaba...@google.com
(No comment was entered for this change.)
Labels: -Milestone-2_0_2 Milestone-2_0_3
Feb 24, 2010
#20 jlaba...@google.com
GWT 2.0.3 has been released.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting