Search in sources :

Example 1 with MessageBox

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));
        }
    });
}
Also used : CloseEvent(com.sencha.gxt.widget.core.client.event.CloseEvent) MessageBox(com.sencha.gxt.widget.core.client.box.MessageBox) RecordTransaction(org.activityinfo.model.resource.RecordTransaction)

Example 2 with MessageBox

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;
}
Also used : MessageBox(com.sencha.gxt.widget.core.client.box.MessageBox)

Example 3 with MessageBox

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();
}
Also used : MessageBox(com.sencha.gxt.widget.core.client.box.MessageBox)

Example 4 with MessageBox

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();
}
Also used : MessageBox(com.sencha.gxt.widget.core.client.box.MessageBox)

Example 5 with MessageBox

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();
}
Also used : MessageBox(com.sencha.gxt.widget.core.client.box.MessageBox)

Aggregations

MessageBox (com.sencha.gxt.widget.core.client.box.MessageBox)6 CloseEvent (com.sencha.gxt.widget.core.client.event.CloseEvent)1 RecordTransaction (org.activityinfo.model.resource.RecordTransaction)1