I have a GWT place where a user must create some object before he/she can navigate away from there. I tried using
eventBus.addHandler(PlaceChangeRequestEvent.TYPE, new PlaceChangeRequestEvent.Handler() {
@Override
public void onPlaceChangeRequest(PlaceChangeRequestEvent event) {
event.setWarning("must create the object");
}
});
but this shows a warning box and then user can click "OK" and still leave the place. I can put the enforcing code to my PlaceController instance, but I thought maybe there was a way to call something like event.cancel() when I get a PlaceChangeRequestEvent instance.