use of io.jmix.ui.component.TextField 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());
}