how to make an (load)image overlay an panel

422 views
Skip to first unread message

tanteanni

unread,
Apr 24, 2012, 7:03:57 AM4/24/12
to google-we...@googlegroups.com
in my app i have some interactive widgets but while loading data from server this widgets must be inactivated and activated again after loading is complete. i don't want to make the widgets invisible or inactivate every single field/button. 
the best solution would be a transparent panel with an loading image in its center or corner overlaying the widgets while loading - but how to achieve that?

Jens

unread,
Apr 24, 2012, 7:20:42 AM4/24/12
to google-we...@googlegroups.com
in my app i have some interactive widgets but while loading data from server this widgets must be inactivated and activated again after loading is complete. i don't want to make the widgets invisible or inactivate every single field/button. 
the best solution would be a transparent panel with an loading image in its center or corner overlaying the widgets while loading - but how to achieve that?

If you only want to overlay specific parts of your app (a complete overlay would be a PopupPanel with glass panel active), I would probably create a simple UiBinder view based on HTML (give it an absolute position with top,left,bottom,right being 0) and then just append/remove it to/from the appropriate parent element. The parent element should have a position:relative applied. 

But this only will disallow mouse events.. you can still tab through the controls and activate them using the keyboard I think.

-- J.

tanteanni

unread,
Apr 24, 2012, 7:26:07 AM4/24/12
to google-we...@googlegroups.com
thx

but i need complete deactivation of specific widgets - so this i have to do "manually"? Since i don't use uiBinder how would such an view look like written in java ? 

l.denardo

unread,
Apr 24, 2012, 9:45:56 AM4/24/12
to Google Web Toolkit
Two simple ptions (forgive me if they're too basic):

*Your widgets to be activated are likely FocusWidgets: simply register
them in a collection while you build your GUI and iterate over that to
activate-deactivate them all

*Use a (modal, if you don't want the background to be clickable)
PopupPanel or DialogBox with the load image you prefer: set a primary
style name to the widget using setStylePrimaryName(String name), add
that to your CSS and adust the CSS properties to have no border and a
transparent background, then center() / hide() your popup before and
after load.

regards
Lorenzo

tanteanni

unread,
Apr 24, 2012, 10:31:14 AM4/24/12
to google-we...@googlegroups.com
in meantime i got answer on stackoverflow that fits very well (didn't tried it yet):  http://stackoverflow.com/questions/10296712/how-to-make-an-loadimage-overlay-a-panel 
Reply all
Reply to author
Forward
0 new messages