showRelativeTo doesn't work the first time

69 views
Skip to first unread message

Dennis Haupt

unread,
Aug 3, 2011, 3:48:09 AM8/3/11
to google-we...@googlegroups.com
there seems to be something wrong with my popups. the first time i try to show a popup via showRelativeTo(someWidget), it simply doesn't show with firefix and chrome. ie9 works fine.
both times, the coordinates are equal. PopupPanel.setPopupPosition is called with the same parameters, so it's not an out-of-screen-coordinates problem. any hints?

Brian Reilly

unread,
Aug 3, 2011, 8:57:34 AM8/3/11
to google-we...@googlegroups.com
I've had issues with positioning (specifically centering) when setting dimensions of the popup contents using CSS (width in my case, but I imagine hight could have similar issues). My dialog box would be positioned too far to the right the first time is was displayed using center(). The second and successive calls to center() would work properly. Especially strange is that the behavior was the same even when creating new instances of the dialog box. (My testing was in Safari)

Calling setWidth() on the dialog's widget from java instead of using CSS fixed it for me.

-- Brian

Eric Andresen

unread,
Aug 3, 2011, 9:37:08 AM8/3/11
to google-we...@googlegroups.com
I've also seen similar problems with showRelativeTo.  I've noticed that if I show a popup dialog that has dynamic sizing (i.e. the widget is a FlowPanel), the first time it pops up it shows as very wide and goes off the screen.  If I close and re-open it, the second time it correctly wraps its contents to the boundary of the window.  I think maybe there is a timing problem with the position() call inside showRelativeTo?

Dennis Haupt

unread,
Aug 3, 2011, 1:33:52 PM8/3/11
to google-we...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

figured it out, in my case i've opened the popup via a clicklistener on
a hyperlink. the first time, the dialog opened and immediately closed
again because of the history event

> -- You received this message because you are subscribed to the
> Google Groups "Google Web Toolkit" group. To view this discussion on
> the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/6RNX_a3ruMUJ. To
> post to this group, send email to
> google-we...@googlegroups.com. To unsubscribe from this group,
> send email to google-web-tool...@googlegroups.com. For
> more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOOYaAAAoJENRtux+h35aGPoUP/3FrqvyU7D6Cyh9sFpwIdWUl
rAkHJxK79mmUYvoXiOyI4p73ZZrYPl2I85DAs4tYymQ7rkehq6Tl1j/5KFh6yxfn
s366E9vFK6zdg6/0I5XaIuFc4sQsSMrJtUaKQ81cZdrlU/+aVa7El1kSa23QSppF
HKLA0rFvH9AO5OhfIDgOXM/xHwg8kYDq/Ev43PA14hNLy4EHqiur8Qqcf2o4lxgj
QCGMwXZy1/7f0+LEHHZo00ey+/NGneSSv13e+hKrzzq3kzC2ipVq+b1uii5tOX6e
LkTb2+l+XnjDOC6hD7HAyolJ/RqQkLS8bWA6Ex7h2k2iIIgLb38hvHQsOj/yULmA
Rl3E3pk22+jRkQDV3Hk6DeQ5T2lLNTUJt2rkhTd5EV+N3E8/U7TN+Z5KzZcf+ArB
Z7wq1s7j5RmJoxD4gP4SqaNm5IFX+p0raWIsvz1IWdHMS9WCCieoU8wdqkwEzd0Y
NDbyW6G8sXhS6l5BUU/g9y1jn7bX6Tu51yLJTVx7+McsgpqbGuS4/db/B4BlRl04
Jp1cJh7m/bJ5RkDbcxgSDxZb76wQ8M1QI16uBaYvFZ2W8hu37Qq5NoWetVRqM/MS
gYEFapevaO2SGHt16mQV9EJzZYcKcFdBTpPKvbTBUeJNLGpReE7GCMLatunFCxjs
d96MNN7ShYURm+QvYF2i
=mZmw
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages