On Sunday, April 22, 2012 5:11:45 AM UTC+2, Brandon Donnelson wrote:
>
> I'd like to suggest a PlaceController Enhancement with the Delegate 
> overriding so I can have the place controller check if the warning has been 
> cleared.
>
> I'd like to build my own popup dialog as the delegate which is non 
> blocking, and goto the newPlace when my saving data is done, instead of 
> asking for the person to cancel an go do the saving manually. Basically, 
> I'd like to tell the Place Controller via event that its ok now, or easier 
> would be to say, check the warning message again, b/c it should be cleared. 
>
> Currently the confirmation dialog is blocking and returns boolean in the 
> place controller and I'd like to control the maybeGotoPlace with events. 
>
> Thoughts?
>
>
> public class PlaceController {
> //...
>   public void goTo(Place newPlace) {
>     log().fine("goTo: " + newPlace);
>
>     if (getWhere().equals(newPlace)) {
>       log().fine("Asked to return to the same place: " + newPlace);
>       return;
>     }
>
>     // NOTE: delegate.confirm(warning) is blocking until dialog comes back 
> true|false
>     String warning = maybeGoTo(newPlace);
>     if (warning == null || delegate.confirm(warning)) {
>       where = newPlace;
>       eventBus.fireEvent(new PlaceChangeEvent(newPlace));
>     }
>   }
> //...
> }
>
>

And how would you handle navigation (via bookmarks or the browser's 
history) while your popup is showing? (with the edge-case: what if I go 
back to the place I'm leaving? e.g. click the "back" button of your 
browser, the app shows the popup  , and now click "forward")

That being said, PlaceController is a so simple and "decoupled" class that 
the idea (and goal) was that if it doesn't fit your needs, then simply 
don't use it and make your own instead.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/PB9URscsS0AJ.
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.

Reply via email to