On 26 août, 16:46, WardLoockx <[email protected]> wrote:
> Hello,
>
> I'm very new to GWT and having some questions about the event system.
>
> What I wan't to do is fire events when my async calls are executed so
> I can listen to this events to update the UI.

Have you looked at Ray Ryan's session at Google I/O ?
http://code.google.com/events/io/sessions/GoogleWebToolkitBestPractices.html

I believe some of the code samples (download the slides, they're much
more usable than the video ;-) ) would answer your questions.

> my questions:
>
> - Can I create event on the fly ? with just a type name (so I can
> listen on that type of event)

Could you explain what you mean by "type name"? Also, which kind of
events would you like to create? I need some more context to
understand the question...

> - public HandlerManager(java.lang.Object source) you supply an object
> to the constructor, isn't it just one bus /    application ?

HandlerManager is what manages the events within widgets too. For, for
instance, someClickEvent.getSource() to be the Button widget you just
clicked, the HandlerManager backing the Button's event handling needs
a reference to the button instance.
...but there are many cases where you don't need a source (such as
when using HandlerManager as an event bus), in those cases, just use
'null'.
(note: History also uses a HandlerManager, and it uses a 'null'
source, so ValueChangeEvent<String>#getSource() in your
ValueChangeHandler<String> will return null)

> - Can I use event bubbling?

Er, at which level? bubbling from which point to which point? If you
mean "in a custom widget, can I register a clickhandler to be notified
whenever a child DOM element is clicked?" then yes, because click
events bubble on the DOM:
http://code.google.com/webtoolkit/doc/1.6/FAQ_UI.html#How_can_I_efficiently_handle_events_from_many_interior_Widgets?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to