I am just not getting the new Event handling.  I have went over every
example I can find, but it is not clicking. How do you let composite
widgets subscribe to events from other composite widgets? From reading
it sounds like there is a HandlerManager that you register with by
implementing the HasxxHandlers interface, but I cannot piece together
how the Class that creates the event fires it off to the subscribers.

For example I have the following SimpleWidget that extends Composite
that contains a single button. I have another Composite widget that
wishes to be notified when that button is clicked. Can someone fill in
the blanks for me?

(Note I did not attempt to add the event handlers because I do not
want to confuse others who may have the same issue.)

public class SimpleWidget extends Composite{

        private Button button;

        public SimpleWidget() {
                FlowPanel fp = new FlowPanel();
                button = new Button("Click me");
                //With listeners I would create an anonymous inner class
                //that fires the click events to registered listeners.
                //I don't know how to fire events for handlers
                //button.addClickHandler(handler);???
                fp.add(button);
                initWidget(fp);
        }
}

public class DoSomething extends Composite{

                public DoSomething() {
                        FlowPanel fp = new FlowPanel();
                        SimpleWidget simple = new SimpleWidget();

                        fp.add(simple);
                        initWidget(fp);
        }
}
--~--~---------~--~----~------------~-------~--~----~
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-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to