The code example you provided works perfectly! It reloads the place
without refreshing the entire page.

Instead of making a class i just added it into an onClick event in my
application. Because of this i couldn't figure out how to create the
delegate variable but removing it and the || delegate.confirm(warning)
didn't seem to affect it.

Thanks for your help.

Cheers,
-Mark

On Nov 9, 3:34 pm, Jens <jens.nehlme...@gmail.com> wrote:
> 1.) You can do a Window.Location.reload() which will reload your page which
> in turn will load the same place again (url does not change and should
> reflect the current app state).
>
> 2.) A different way would be to create a custom PlaceController that
> provides a method like .forcedGoTo(Place newPlace) which would skip the
> equals() check between getWhere() and the new place. PlaceController is a
> pretty simple class, take a look at its source code.
>
> 3.) Maybe you could also copy some code from the PlaceController if you
> dont want to introduce a custom PlaceController:
>
> public class PlaceUtils {
>
>   public static void reloadCurrentPlace(PlaceController.Delegate delegate,
> EventBus eventBus, PlaceController placeController) {
>     Place where = placeController.getWhere();
>     //Taken from PlaceController.maybeGoTo()
>     PlaceChangeRequestEvent willChange = new PlaceChangeRequestEvent(where);
>     eventBus.fire(willChange);
>     String warning = willChange.getWarning();
>     //Taken from PlaceController.goTo()
>     if(warning == null || delegate.confirm(warning)) {
>       eventBus.fire(new PlaceChangeEvent(where));
>     }
>   }
>
> }
>
> Haven't tried it but maybe it works. Thats basically what
> PlaceController.goTo() does but without the equals check (and this code
> also does not update the "where" instance variable of PlaceController as
> its not possible from outside. But as the code works on the same place
> instance the whole time it does not have to update the "where" variable).
> The default implementation of PlaceController.Delegate is
> PlaceController.DefaultDelegate.
>
> -- J.

-- 
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-toolkit@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.

Reply via email to