InputDialogFacet gives you an alternative way to configure and open an input dialog. Instead of using the Dialogs.createInputDialog() method in the screen controller, you can configure InputDialogFacet in the XML descriptor with the help of Studio visual designer.

Component’s XML-name: inputDialog.


InputDialogFacet is defined in the facets element of the screen XML descriptor and has the following attributes:

  • dialogActions - allows you to add the most frequently used actions with the corresponding buttons to the dialog. There are the following possible values:

    • OK_CANCEL - adds the OK and Cancel buttons. The default value.

    • OK - adds the OK button.

    • YES_NO - adds the Yes and No buttons.

    • YES_NO_CANCEL - adds the Yes, No, and Cancel buttons.

  • onAction - defines id of an action which should trigger the dialog opening.

  • onButton - defines id of a button which should trigger the dialog opening.


See actions.


To add input fields to the dialog, create the nested elements listed below inside the parameters element. For each parameter, a corresponding visual component will be created for entering the value.

Parameter Visual Component


TextField with the decimal data type


DateField with the DAY resolution


DateField with the MIN resolution


TextField with the double data type


TextField with the int data type


TextField with the long data type





All the parameters described above have the defaultValue attribute for setting the default value for the corresponding field.

    <bigDecimalParameter id="bigDecimalParameter"
                         caption="Big Decimal Parameter"
  • Use entityParameter to display EntityPicker. To define the entity class for the corresponding field, use the entityClass attribute.

        <entityParameter caption="Entity Parameter"
  • Use enumParameter to display ComboBox. To define the enum class for the corresponding field, use the enumClass attribute.

        <enumParameter caption="Enum Parameter"

Events and Handlers

To generate a handler stub in Jmix Studio, select the facet in the screen descriptor XML or in the Jmix UI hierarchy panel and use the Handlers tab of the Jmix UI inspector panel.

Alternatively, you can use the Generate Handler button in the top panel of the screen controller.


The InputDialogCloseEvent is sent when the dialog is closed. With the help of the InputDialogCloseEvent.closedWith() method, you can track how the dialog was closed:

private Notifications notifications;

public void onInputDialogInputDialogClose(InputDialog.InputDialogCloseEvent event) {
    if (event.closedWith(DialogOutcome.OK)) {
                .withCaption("The order will be displayed in your profile within 5 minutes")

Programmatic registration of the event handler: use the addCloseListener() method.


The DialogResultHandler delegate method allows you to handle input dialog results:

private Notifications notifications;

@Install(to = "inputDialog", subject = "dialogResultHandler")
private void inputDialogDialogResultHandler(InputDialog.InputDialogResult inputDialogResult) {
    String closeActionType = inputDialogResult.getCloseActionType().name();

    String values = inputDialogResult.getValues().entrySet()
            .map(entry -> String.format("%s = %s", entry.getKey(), entry.getValue()))
            .collect(Collectors.joining(", "));

            .withCaption("InputDialog Result Handler")
            .withDescription("Close Action: " + closeActionType +
                    ". Values: " + values)

Programmatic usage: call the setDialogResultHandler() method.


The Validator delegate method allows you to validate input values. It receives specific InputDialog.ValidationContext, which contains entered values. The method must return the ValidationErrors instance, which includes descriptions for errors. These errors will be shown in a notification with other validation exceptions.

@Install(to = "inputDialog", subject = "validator")
private ValidationErrors inputDialogValidator(InputDialog.ValidationContext validationContext) {
    String phone = validationContext.getValue("phoneField");
    String address = validationContext.getValue("addressField");
    if (Strings.isNullOrEmpty(phone) && Strings.isNullOrEmpty(address)) {
        return ValidationErrors.of("Phone or Address must be filled");
    return ValidationErrors.none();

Programmatic usage: call the setValidator() method.

All XML Attributes

You can view and edit attributes applicable to the facet using the Jmix UI inspector panel of the Studio’s Screen Designer.