Forums

Repeated drop-down list value (with read_data & autocomplete)

shiluba 03 Mar, 2021
Hello,I'm using a repeater area with "Content Multiplier" enabled. It contains a dynamic drop-down list using "Allow additions" and an "AutoComplete Event".
The repeater has a data provider {var:array} : a "read data" results array using this very simple scheme : [ "one"=>"one", "two"=>"two", etc. ]

Thus the drop-down list is very simple too. It is set with these Options ...
{var:repeater_name.key}={var:repeater_name.key}
... and this Selected value ...
{var:repeater_name.key}

The label of most drop-down lists is correct, whether it is based on the data provider or the Autocomplete event. But when loading the blank form, the drop-down list has no default label. And when adding a new repeat, the label of the new drop-down list is the number of repeats.
Instead of that, how could I use a default label (while keeping the use of the data provider and of the autocomplete feature) ?
shiluba 03 Mar, 2021
Here is an example based on the autocomplete demo. It loads 5 articles titles. The additional dropdowns show the repeater key. Let's try to display a default label instead!
shiluba 04 Mar, 2021
It appears to work better with options :
{var:repeater_name.key}={var:repeater_name.row}

With this, the additional dropdowns are blank. It's not a default label like "Start typing and select", but it's cleaner than showing the repeater key.
I'd be happy trying a better way to build that and show a default value. Meantime, I'll go with this.
You need to login to be able to post a reply.