Steps to reproduce
- Have a class with a static list property, e.g. status with the values DRAFT=draft|DISCLOSED=disclosed, and a few pages holding an object of it with different values.
- Display them in a live data which filters on that property by default, either with the macro parameter or with the live data configuration:
{{liveData
id="test"
properties="doc.title,status"
source="liveTable"
sourceParameters="className=Sandbox.TestClass"
filters="status=DISCLOSED"
/}}
or
{"query": {"filters": [{"property": "status", "constraints": [{"operator": "equals", "value": "DISCLOSED"}]}]}}
- View the page.
Expected The status column filter (and the advanced filter panel) display the default filter value, disclosed, so that the user knows the entries are filtered and can remove the filter from there. Actual The entries are correctly filtered, but the status column filter and the value of the advanced filter panel look empty: the user can't see that the entries are filtered, nor remove the filter from the column. Cause In FilterList.vue, the selectize settings pass options: this.config.options || []. When the filter descriptor has no options (the values are only suggested through its searchURL, as for a static list property of the liveTable source), that empty array replaces the option Tom Select creates from the initial value of the input. The initial item is then dropped since no option matches it, so it's not selected, and its label is never loaded through loadSelected. Reproduced on 18.4.6 (Tom Select). The same FilterList.vue code is in 17.10.0 (Selectize), not verified there yet. Workaround Pass the options of the list filter explicitly in the live data configuration, so that the initial value is among them:
{"meta": {"propertyDescriptors": [{"id": "status", "filter": {"options": [{"value": "DRAFT", "label": "draft"}, {"value": "DISCLOSED", "label": "disclosed"}]}}]}}
|