1.4 RC: PopupPanel breaking upon calling UIObject.setVisible(false)

15 views
Skip to first unread message

hoosie

unread,
May 30, 2007, 12:20:02 PM5/30/07
to Google Web Toolkit
Looking for any advice or thoughts on whether this is my mistake or a
bug in 1.4 . My code has worked up until now, and I get the
following error while calling setVisible(false); in a PopupPanel.

[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: JavaScript TypeError
exception: '__frame.style' is null or not an object
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
481)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:
270)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:
137)
at
com.google.gwt.user.client.ui.impl.PopupImplIE6.setVisible(PopupImplIE6.java:
68)
at
com.google.gwt.user.client.ui.PopupPanel.setVisible(PopupPanel.java:
314)
at com.test.client.azwidget.AZDialogBox.fadeIn(AZDialogBox.java:171)
at com.test.client.aztables.AZTable.onClick(AZTable.java:286)
at
com.google.gwt.user.client.ui.ClickListenerCollection.fireClick(ClickListenerCollection.java:
36)
at
com.google.gwt.user.client.ui.FocusWidget.onBrowserEvent(FocusWidget.java:
98)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1211)

hoosie

unread,
May 30, 2007, 12:52:10 PM5/30/07
to Google Web Toolkit
For the record the reason for setting the UIObject to invisible is to
use a scriptaculous library to later fade it in.. this did work until
today.

timmys

unread,
May 31, 2007, 2:45:10 AM5/31/07
to Google Web Toolkit
I get the same error!

It worked fine in 1.3.

Actually it breaks in the ColourPicker widget by Robert Hanson. Source
code: http://www.manning.com/hanson/

Maybe it's because there is a Popup Panel within another Popup panel?
(I show the ColourPicker widget in a Popup Panel )


Xiris

unread,
May 31, 2007, 5:55:34 AM5/31/07
to Google Web Toolkit
I Also have the same error. I have a login dialog that appears when
you first load my application. The dialog fades in using the
scriptaculous library and removing the setVisible(false) fixes the
error, but then I don't have the nice fade in effect :(

Anyone got any ideas on a fix?

Jon

hoosie

unread,
May 31, 2007, 11:14:14 AM5/31/07
to Google Web Toolkit
I have created Issue 1120 to address this.

Danjel

unread,
May 31, 2007, 4:15:42 PM5/31/07
to Google Web Toolkit
Hide() and Show() works however. (this is also the case for dialogs)

I have also noticed some difference with the setpopupposition in
popuppanel

regards
/Danjel

hoosie

unread,
May 31, 2007, 4:18:39 PM5/31/07
to Google Web Toolkit
hide and show work, however we're using a trick to make the dialog's
fade in, whereby you set them invisible, show them, and then fade them
in. This has worked fine up until this version, and nothing in the
documentation points to any intended reason why.

krispy

unread,
May 31, 2007, 4:44:23 PM5/31/07
to Google Web Toolkit
hoosie,

Looking at the source, it seems that the setVisible call inside of
PopupPanel is sent to a standard PopupImpl class, which in turn does
nothing (blank method). However, it looks like for 1.4, this behavior
was overridden inside of the PopupImplIE6 so as to call a __frame
element on the popup. However, this __frame element is not created
until you call show() for the first time - thus, in order to say
setVisible(true) you MUST call show() first. It seems like this was
in response to a separate bug fix - to work around it, you could
comment out the code that calls impl.setVisible() inside of
PopupPanel, call show() and then setVisible() on your popup, or any
number of other things. This seems intentional on the part of GWT -
I guess the reason for it might be that you should be adding your
popups to the DOM first before doing any styling (which is really what
setVisible is).

HTH,

-krispy

hoosie

unread,
May 31, 2007, 7:10:55 PM5/31/07
to Google Web Toolkit
Thanks Krispy, I'll certainly give that a try. I wonder if there is
any other way to accomplish the same end without having to override
the PopupPanel class.

timmys

unread,
Jun 1, 2007, 8:32:42 AM6/1/07
to Google Web Toolkit
Speaking of Popup Panels...

I experience another strange thing in RC 1.4. I have a
screenCenterPopupPanel() method that is called in an overloaded onload
method of PopupPanel. The method uses the getOffsetWidth() method of
the popup panel to calculate the rigth position of of the popup.
However the getOffsetWidth() returns a value that is way to big
(approx. the same width as the browser window total width). The
getOffsetHeight() works fine.

All of this worked fine with the snapshot gwt-windows-0.0.858.

I've only tried this in IE7, so I don't know if it's a general
problem...

krispy

unread,
Jun 1, 2007, 9:42:29 AM6/1/07
to Google Web Toolkit
If you call show() first, you don't have to override the PopupPanel
class - why can't you just call show() first? It seems like you'd
have to have added the popup to the root panel before you could do any
scriptaculous effects anyways ... but I've never used it, so maybe you
could enlighten me?

-krispy

Bob

unread,
Jun 13, 2007, 1:14:49 PM6/13/07
to Google Web Toolkit
hi all, I meet this problem tonight. but even more when I call hide()
and later call show() then I can not drap the dialogBox.any know how
to solve?

Bruce Johnson

unread,
Jun 28, 2007, 6:46:12 AM6/28/07
to Google-We...@googlegroups.com
Thanks for entering the bug. #1120 is fixed in the svn trunk now. If anyone on this thread ever builds from source, you could try it out to see if it fixes your problem.

-- Bruce

davidroe

unread,
Jun 28, 2007, 3:38:12 PM6/28/07
to Google Web Toolkit
I seem to remember, when browsing the source for 1.4 PopupPanel, that
it has a method called center() which may do what you want.
Reply all
Reply to author
Forward
0 new messages