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;
}
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());
}
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);
}
}