Search in sources :

Example 1 with CheckBox

use of io.jmix.ui.component.CheckBox in project jmix by jmix-framework.

the class UiDataFilterConfigurationModelFragment method createDefaultForMeField.

protected CheckBox createDefaultForMeField() {
    CheckBox defaultForMeField = uiComponents.create(CheckBox.NAME);
    defaultForMeField.setValueSource(new ContainerValueSource<>(configurationDc, "defaultForMe"));
    String caption = messageTools.getPropertyCaption(configurationDc.getEntityMetaClass(), "defaultForMe");
    defaultForMeField.setCaption(caption);
    defaultForMeField.setWidthFull();
    return defaultForMeField;
}
Also used : CheckBox(io.jmix.ui.component.CheckBox)

Example 2 with CheckBox

use of io.jmix.ui.component.CheckBox in project jmix by jmix-framework.

the class FilterSaveAsAction method initInputDialogFormFields.

@SuppressWarnings("unchecked")
protected void initInputDialogFormFields(Form form) {
    CheckBox generatedIdField = (CheckBox) form.getComponentNN("generatedIdField");
    TextField<String> idField = (TextField<String>) form.getComponentNN("idField");
    idField.setEnabled(!generatedIdField.isChecked());
    generatedIdField.addValueChangeListener(valueChangeEvent -> {
        boolean checked = BooleanUtils.isTrue(valueChangeEvent.getValue());
        idField.setEnabled(!checked);
    });
    TextField<String> nameField = (TextField<String>) form.getComponentNN("nameField");
    nameField.addValueChangeListener(valueChangeEvent -> {
        if (generatedIdField.isChecked()) {
            idField.setValue(generateConfigurationId(valueChangeEvent.getValue()));
        }
    });
    generatedIdField.setVisible(componentProperties.isFilterShowConfigurationIdField());
    idField.setVisible(componentProperties.isFilterShowConfigurationIdField());
}
Also used : CheckBox(io.jmix.ui.component.CheckBox) TextField(io.jmix.ui.component.TextField)

Example 3 with CheckBox

use of io.jmix.ui.component.CheckBox in project jmix by jmix-framework.

the class UiDataFilterConfigurationModelFragment method initFirstConfigurationFormRow.

protected void initFirstConfigurationFormRow() {
    TextField<String> nameField = createNameField();
    if (defaultForMeFieldVisible) {
        configurationForm.add(nameField, 0, 0);
        CheckBox defaultForMeField = createDefaultForMeField();
        configurationForm.add(defaultForMeField, 1, 0);
    } else {
        configurationForm.add(nameField, 0, 0, 2, 1);
    }
}
Also used : CheckBox(io.jmix.ui.component.CheckBox)

Aggregations

CheckBox (io.jmix.ui.component.CheckBox)3 TextField (io.jmix.ui.component.TextField)1