How to implement "Hover Over" or Popup in GWT

1,123 views
Skip to first unread message

insaneyogi

unread,
Mar 25, 2008, 8:18:43 PM3/25/08
to Google Web Toolkit
Hello,
I have a specific scenario which I am interested in
implementing . I have this Grid or table consisting of 5
columns ...whenever the moves over any one of the cells in the 4th
column a pop up needs to emerge displaying some further details , can
anybody give me any ideas on what interface will be best suited for
this purpose & general tips for implementing this .


With Regards

Carl Scott

unread,
Mar 26, 2008, 1:22:37 AM3/26/08
to Google Web Toolkit
MyGWT has this inherently implemented should you be using that
interface but it doesn't sound like it. The roundabout way I usually
implement something like this:

1) Create a Widget. In the constructor, sinkEvents(Event.MOUSEEVENTS)

2) Override the onBrowserEvent(Event evt) method, and do a switch on
the DOM.eventGetType(evt) to find interesting events like ONMOUSEOVER
and ONMOUSEOUT. Use a combination of PopupPanel plus the knowledge of
where to popup at (you can get the event coordinates from the DOM and
adjust accordingly should your grid be falling off the screen) to show
a panel containing your grid. Show on mouse over, hide on mouse out.

3) Save the code for future use. :)

Hope that helps!

--
Carl Scott
Software Developer, Solertium Corporation

walden

unread,
Mar 26, 2008, 8:12:45 AM3/26/08
to Google Web Toolkit
insaneyogi,

You could say a little more about the information that needs to pop
up, and whether it needs to be interactive, and how you would have it
"pop down". Because a simple, non-interactive, auto-pop-down-when-you-
mouse-away implementation is to just set the title attribute of
whatever is in those cells. So kindly elaborate your requirement...

Walden

On Mar 25, 8:18 pm, insaneyogi <srinivas.sa...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages