Manually fire a mouseout event?

709 views
Skip to first unread message

darkflame

unread,
Aug 27, 2010, 4:46:36 PM8/27/10
to Google Web Toolkit
How would I manually fire a mouseout event?

I've tried a few things, but I'm clearly not hitting the mark;

//closeIcon.fireEvent(GwtEvent<MouseOutHandler>);

//DomEvent.fireNativeEvent( MouseOutEvent.getType(),
(HasHandlers)closeIcon);

//MouseOutEvent.fireNativeEvent(nativeEvent, closeIcon);

None of those even validate in eclipse, let alone run.

Basically closeIcon is a widget of unknown form which I want to
trigger (or try to) trigger the event on.

Any ideas?


Gal Dolber

unread,
Aug 27, 2010, 5:18:09 PM8/27/10
to google-we...@googlegroups.com

NativeEvent nativeEvent = Document.get().createMouseOutEvent(detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget);

MouseOutEvent.fireNativeEvent(nativeEvent, yourWidget);


2010/8/27 darkflame <dark...@gmail.com>


--
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.




--
Guit: Elegant, beautiful, modular and production ready gwt applications.


darkflame

unread,
Aug 28, 2010, 8:22:34 AM8/28/10
to Google Web Toolkit
Worked a charm, thanks!

On Aug 27, 11:18 pm, Gal Dolber <gal.dol...@gmail.com> wrote:
> NativeEvent nativeEvent = Document.get().createMouseOutEvent(detail, screenX,
> screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button,
> relatedTarget);
>
> MouseOutEvent.fireNativeEvent(nativeEvent, yourWidget);
>
> 2010/8/27 darkflame <darkfl...@gmail.com>
>
>
>
>
>
> > How would I manually fire a mouseout event?
>
> > I've tried a few things, but I'm clearly not hitting the mark;
>
> > //closeIcon.fireEvent(GwtEvent<MouseOutHandler>);
>
> > //DomEvent.fireNativeEvent( MouseOutEvent.getType(),
> > (HasHandlers)closeIcon);
>
> > //MouseOutEvent.fireNativeEvent(nativeEvent, closeIcon);
>
> > None of those even validate in eclipse, let alone run.
>
> > Basically closeIcon is a widget of unknown form which I want to
> > trigger (or try to) trigger the event on.
>
> > Any ideas?
>
> > --
> > 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<google-web-toolkit%2Bunsubs cr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> Guit: Elegant, beautiful, modular and *production ready* gwt applications.
>
> http://code.google.com/p/guit/

Bernmeister

unread,
Sep 15, 2010, 7:26:09 PM9/15/10
to Google Web Toolkit
Was wondering if you could do a little test for me please. I've found
that if I fire an event such as

ChangeEvent.fireNativeEvent( Document.get().createChangeEvent(),
myListBox );

the event fires, but if I have any code immediately after, that code
does NOT get executed.

For example if I have

Window.alert( "here" );
ChangeEvent.fireNativeEvent( Document.get().createChangeEvent(),
myListBox );
Window.alert( "there" );

I get "here" but not "there".

So when you fire your event, could you please do the same thing (put
in a Window.alert or other code to see if it is executed AFTER the
event firing is called)?

FYI: I've logged the whole sordid story here
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/891d509f168efa34
Reply all
Reply to author
Forward
0 new messages