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 view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/7wDFBobDcQUJ.
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.