use of com.sencha.gxt.widget.core.client.box.MessageBox in project activityinfo by bedatadriven.
the class FormInputView method save.
public void save(CloseEvent.CloseHandler closeHandler) {
// If the view model is still loading, ignore this click
if (viewModel == null) {
return;
}
if (!viewModel.isValid()) {
MessageBox box = new MessageBox(I18N.CONSTANTS.error(), I18N.CONSTANTS.pleaseFillInAllRequiredFields());
box.setModal(true);
box.show();
return;
}
// Good to go...
RecordTransaction tx = viewModel.buildTransaction();
LOGGER.info("Submitting transaction: " + Json.stringify(tx));
formStore.updateRecords(tx).then(new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
MessageBox box = new MessageBox(I18N.CONSTANTS.serverError(), I18N.CONSTANTS.errorOnServer());
box.setModal(true);
box.show();
}
@Override
public void onSuccess(Void result) {
closeHandler.onClose(new CloseEvent(null));
}
});
}
use of com.sencha.gxt.widget.core.client.box.MessageBox in project activityinfo by bedatadriven.
the class KeyedSubFormPanel method canChangePeriod.
private boolean canChangePeriod() {
if (viewModel.getActiveSubViewModel().isDirty() && !viewModel.getActiveSubViewModel().isPlaceholder() && !viewModel.getActiveSubViewModel().isValid()) {
MessageBox box = new MessageBox(I18N.CONSTANTS.error(), I18N.CONSTANTS.pleaseFillInAllRequiredFields());
box.setModal(true);
box.show();
return false;
}
return true;
}
use of com.sencha.gxt.widget.core.client.box.MessageBox in project oxCore by GluuFederation.
the class GwtUtils method showError.
public static void showError(String message) {
final MessageBox d = new MessageBox("Error", message);
d.setIcon(MessageBox.ICONS.error());
d.setHideOnButtonClick(true);
d.show();
}
use of com.sencha.gxt.widget.core.client.box.MessageBox in project oxCore by GluuFederation.
the class GwtUtils method showInformation.
public static void showInformation(String message) {
final MessageBox d = new MessageBox("Information", message);
d.setIcon(MessageBox.ICONS.info());
d.setHideOnButtonClick(true);
d.show();
}
use of com.sencha.gxt.widget.core.client.box.MessageBox in project activityinfo by bedatadriven.
the class AppCacheMonitor3 method promptUser.
private void promptUser() {
MessageBox messageBox = new MessageBox("ActivityInfo");
messageBox.setMessage(I18N.CONSTANTS.newVersionChoice());
messageBox.setPredefinedButtons(Dialog.PredefinedButton.OK, Dialog.PredefinedButton.CANCEL);
messageBox.getButton(Dialog.PredefinedButton.OK).addSelectHandler(event -> {
appCache.loadUpdate();
});
messageBox.show();
}
Aggregations