On Jun 16, 3:52 am, Sky <myonceinalifet...@gmail.com> wrote: > Well, I don't know about the event bus and I have yet to watch that > GWT best practices video (but I really should!) and I haven't done MVP > with GWT, BUT I'm super creative so here's what I would do with your > situation! :D > > I would have an object that is rather more aware of the all > recoverPanelFromHistory async actions going on. This object would > store a copy of each other object that is performing the > recoverPanelFromHistory for a specific panel. (in other words a list > of objects that have the method(s) controlling all that async > goodness) The code inside recoverPanelFromHistory() that does the > async data retrieval from the server would talk back to this object, > which is the "owner". It tells the Owner that it's finished getting > the data (even when it already had the data cached). Every time the > owner gets told that one of it's "subjects" finished getting data it > checks to see if that was the last "subject" to get it's data, and if > so it talks to the mainContentPanel and gets it to do it's view change > (clear and add). Inside the recoverPanelFromHistory code you can do > your repeatedly trying to obtain the data and even if you don't get > the data until a day later when the user finally reconnects your code > will be able to continue on no prob. > > Did that make sense? It makes sense in my head, so if it doesn't make > perfect sense to you ask me to clarify things and I'll do my best!
Totally makes sense. In other words: make recoverPanelFromHistory async, with a callback passed as an argument rather than returning a value; and if data is cached, then just use the callback synchronously (of call it from a Scheduler.scheduleFinally if it makes you nervous to have your async call actually be synchronous) -- 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-tool...@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.