Hello Robert I had the same problem in various GWT projects until I accidentally stumbled across a little used feature of GWT that completely changed the way I write GWT-apps now: history tokens. History tokens are used to implement control points in the application towards the user can jump at will, but are unfortunately perceived merely as walking-sticks to get bookmarks and the back button working.
But if you think about it, history tokens can do so much more. Essentially they are a messaging mechanism between the view and the business logic. User-driven events (clicks on links, buttons etc) can be captured as history tokens and server-driven events (responses to RPC calls etc) can be covered by programmatically creating new history tokens. Thus you easily separate the sources of events (user actions, server actions) from the control logic and the view. In my applications I typically have four types of classes: 1. The data model which consists of POJOs containing the data the client works with 2. The service classes which consists of the business logic, client side validation and the communication with the server 3. The view which consists of widgets, render the data model and manipulate it. I can feed a model object into a view and get it back from the view, similar to the way Swing works. User actions in the view do _not_ call code from the service classes, but instead create History tokens. 4. The control logic. This is with regard to your question the most interesting part. It implements a HistoryListener and listens to events from the view and asynchronous events from the service classes. It knows the current state and based on the history item it receives via the listener can decide which view to manipulate or which service to call. Essentially, this is the implementation of a control flow. Hope that helps! G. On Mar 5, 4:15 am, rlaferla <[email protected]> wrote: > How is everyone managing to implement sequential workflows when GWT > only allows async calls? > > I have a series of panels that user must respond to in sequence and > their answers may lead to a different path of panels (warnings, error > panels, etc..) I think every GWT programmer working on a large > project must have run into this. I'm interested in what strategies/ > techniques/code you used to help keep the complexity down. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
