nathan, When building composite widgets, it is up to you, within the composite widget, to handle and/or expose whatever events you want. So, if you want to be able to expose click events for multiple buttons in a composite, you may be best off doing one of two things:
1) Create a public enum that contains an entry for each of the buttons. Then, provide a method to get which button was clicked so that when someone handles the click event, they can query for the most recently clicked button. 2) Create custom events for each action that can be taken by the composite widget and you other classes would handle those custom events rather than a click event. Option 2 is better, but more complicated. Generally, when you create a composite widget, the internal widgets are all handled by the composite. If you want access to all the internals, then you aren't really wanting a composite widget at all. HTH, Chad Bourque www.milamade.com On Nov 5, 1:14 pm, nathan <[email protected]> wrote: > I tried event.getSource() but since I created a custom widget, called > CompositeWidget, and I'm listening for a click in the LeftPanel, I > believe event.getSource() is returning LeftPanel, not the > CompositeWidget. So the contents of the CompositeWidget are not > available from event.getSource(). I could be way off on this. > > I think it could have something to do with Event Bubbling. Mentioned > here:http://code.google.com/webtoolkit/doc/1.6/FAQ_UI.html#How_can_I_effic..., > but I don't know how to implement that. > > I should mention that I'm new to GWT, so if I'm just doing something > completely wrong or inefficient, please let me know. > > I put an example of what I'm trying to do > here:https://code.google.com/p/gwtcustomwidgeteventhandling/source/browse/ > > When the "Remove" button is clicked, I want that CompositeWidget to be > removed from the LeftPanel, and it's contents removed from the > RightPanel. > > I understand I'm probably not explaining myself well, and what I put > up may not be the best example, but thanks for any help. -- 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.
