How can you make a working deletion confirmation? The following code obviously won't (and doesn't) work, because the callback to the SC.ask is asynchronous and the event has already been deleted by that point.
Code:
calendar.addEventRemoveClickHandler(new EventRemoveClickHandler() { public void onEventRemoveClick(final CalendarEventRemoveClick calendarEventRemoveClick) { SC.ask("Are you sure you want to delete this event?", new BooleanCallback() { public void execute(Boolean aBoolean) { if (!aBoolean) { // doesn't work - asynch calendarEventRemoveClick.cancel(); } } }); } });
Comment