On 28 août, 05:31, Chris <[email protected]> wrote: > I have a button with three click handlers registered. They are > chained so that the calling order is A, B, C. IMO you shouldn't depend on your handlers call order, you'd rather have a single handler that eventually defers to "subhandlers" (that'd probably wouldn't be ClickHandler's actually) to enforce the call order and what to do on each step. > Is it possible in handler B to "cancel" the event so that further > handlers are not called? No. > The B handler validates that all the required fields are present. If > not, displays an error message and then I want processing to stop. > The C handler does the actual RPC save - which I don't want to happen. As I said above, I'd rather had a single ClickHandler doing something like: public void onClick(ClickEvent event) { if (validate(event.getSource())) { doSendRpc(); } } > I don't see an obvious way to cancel out of the dispatch loop. Throw an exception maybe ? ;-) (hey, it's a joke! don't do it, refactor your code instead!) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
