Search in sources :

Example 1 with MessageBox

use of com.extjs.gxt.ui.client.widget.MessageBox in project activityinfo by bedatadriven.

the class SiteDialogLauncher method promptUseNewEntry.

private static void promptUseNewEntry(final ActivityDTO dto) {
    MessageBox box = new MessageBox();
    box.setTitle(dto.getName());
    box.setMessage(SafeHtmlUtils.fromString(I18N.CONSTANTS.pleaseUseNewDataEntry()));
    box.setButtons(MessageBox.OKCANCEL);
    box.addCallback(messageBoxEvent -> {
        if (messageBoxEvent.getButtonClicked().getItemId().equals(MessageBox.OK)) {
            App3.openNewTable(dto.getFormId());
        }
    });
    box.show();
}
Also used : MessageBox(com.extjs.gxt.ui.client.widget.MessageBox)

Example 2 with MessageBox

use of com.extjs.gxt.ui.client.widget.MessageBox in project activityinfo by bedatadriven.

the class ElementWidget method editTitle.

private void editTitle() {
    final MessageBox box = new MessageBox();
    box.setTitle(I18N.CONSTANTS.changeTitleDialogTitle());
    box.setType(MessageBoxType.PROMPT);
    box.setButtons(Dialog.OKCANCEL);
    box.show();
    box.getTextBox().setValue(model.getTitle());
    box.addCallback(new Listener<MessageBoxEvent>() {

        @Override
        public void handleEvent(MessageBoxEvent be) {
            if (be.getButtonClicked().getItemId().equals(Dialog.OK)) {
                model.setTitle(box.getTextBox().getValue());
                titleElement.setInnerText(ElementTitles.format(model));
            }
        }
    });
}
Also used : MessageBoxEvent(com.extjs.gxt.ui.client.event.MessageBoxEvent) MessageBox(com.extjs.gxt.ui.client.widget.MessageBox)

Aggregations

MessageBox (com.extjs.gxt.ui.client.widget.MessageBox)2 MessageBoxEvent (com.extjs.gxt.ui.client.event.MessageBoxEvent)1