visibleEvent

22 views
Skip to first unread message

gwtomni gwtomni

unread,
Jul 5, 2011, 1:08:10 PM7/5/11
to google-we...@googlegroups.com
hello everyone.
 
   is there any event related to the visibility of a widget on the screen ?
 
thank you

Jeff Larsen

unread,
Jul 5, 2011, 1:19:09 PM7/5/11
to google-we...@googlegroups.com
Not as far as I know. It would be really difficult to implement one properly, because visibility can be changed in so many different ways. CSS, inline etc. 

gwtomni gwtomni

unread,
Jul 5, 2011, 1:30:37 PM7/5/11
to google-we...@googlegroups.com
thank you for your quick response.
 
I have a textBox with a DecoratedPopupPanel on its right like a toolTip. Both of them are in a TabLayoutPanel.
problem is when I am switching between tabs, the toolTip is still visible.
 
I want a way to know that the textBox is no longer visible to be able to hide the toolTip.
 
thank you.

Rob Coops

unread,
Jul 5, 2011, 1:42:12 PM7/5/11
to google-we...@googlegroups.com
In that case you could fire a custom event every time you change the visibility, as far as I know you should be able to figure out if widget X is visible or not by simply asking it ( component.isVisible ).

The only thing is that you will have to ensure that you fire this custom event everywhere in your code where you influence the visibility of a component... To overcome that I would create a custom component and overwrite the (setVisible method, to automatically trigger the event for you) of course as mentioned by Jeff you do need to really make sure that you are not messing it all up with inline styles, css or other methods of messing about with the visibility of your component.

All in all it is not an easy one and it will mean you have to be 100% sure that you never ever set visibility in any other way then problematically which is depending on your project not that hard or near impossible...

Regards,

Rob

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
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.

Jeff Larsen

unread,
Jul 5, 2011, 1:44:18 PM7/5/11
to google-we...@googlegroups.com
Ok, that is a little different. Do you have autohide enabled? That should hide the popup if you click somewhere else. 

Brian Reilly

unread,
Jul 5, 2011, 1:47:45 PM7/5/11
to google-we...@googlegroups.com
A tooltip is something that you generally only have one of on the screen at at time, so you could have a single DecoratedPopupPanel as a sibling of the TabLayoutPanel. Then, create a tooltip event that you fire from a handler on the TextBox to either show/position or hide the tooltip, but also hide the tooltip when switching tabs.

-- Brian


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Jeff Larsen

unread,
Jul 5, 2011, 1:54:06 PM7/5/11
to google-we...@googlegroups.com
Also you could have your textbox be an autohide partner of the popup panel, so that interacting with the TextBox won't hide the PopupPanel
Reply all
Reply to author
Forward
0 new messages