-
Bug
-
Resolution: Fixed
-
Neutral
-
5.3.8
-
None
When using a info.magnolia.ui.form.field.definition.SelectFieldDefinition a (Vaadin) filterMode can be defined according to https://documentation.magnolia-cms.com/display/DOCS/Select
This should enable an user to filter the options by a filter-term. This is useful, if you have a lot of options in the select field.
However, this option has no effect because of two reasons:
info.magnolia.ui.form.field.factory.SelectFieldFactory disables text input with setTextInputAllowed(false); on the combobox, which sets "readonly" on the input-field. See https://jira.magnolia-cms.com/browse/MGNLUI-1088
Second reason is that in the same class pageLength is set to 0 (setPageLength(0)). This was done in 5.3.8 (https://jira.magnolia-cms.com/browse/MGNLUI-3297) and disables the previous paging on select fields (which was set to 10).
Problem is, that the vaadin-combobox ignores filters, when pageLength is 0, see
com.vaadin.ui.ComboBox.getOptionsWithFilter(boolean)
The isssue can be solved by re-enabling textinput and set the page-length to a (high) value:
@Override protected AbstractSelect createFieldComponent() { select = super.createFieldComponent(); if (select instanceof ComboBox) { ((ComboBox) select).setFilteringMode(FilteringMode.CONTAINS); ((ComboBox) select).setTextInputAllowed(true); ((ComboBox) select).setPageLength(100); } return select; }
- is related to
-
MGNLUI-1088 Combo-boxes should not be editable by default
- Closed
-
MGNLUI-3297 Allow for disabling of paging on select field dropdown
- Closed