eeditiones / tei-publisher-components

Web components used by TEI Publisher and apps generated by it
https://cdn.tei-publisher.com/
GNU General Public License v3.0
18 stars 14 forks source link

serializing pb-select with multiple selection / wrap up iron-form #30

Closed tuurma closed 4 years ago

tuurma commented 4 years ago

when pb-select has multi property set, its value is stored in values property as an Array, not in value. iron-form does not pick up this, only allowing select tags to pass in multiple values.

Current solution is rather ugly, on change to the selection copying the selected values to the value property as a array-ish string. As a result, this ugly value is passed on as the request is made, not serialized as expected into a series of key=value parameters.

As discussed today in rocket chat:

WM: as for multi value selects, we have several options: 1) as implemented now, serialize the multiple values using JSON array serialization - but then each value must also be enclosed in quotes; 2) serialize the multiple values into a simple string using a configurable separator char like ‘;’, ‘-‘ or whatever; 3) create a wrapper around iron-form which handles the case of multi-value pb-select and serializes them as a series of parameters with the same name. I can say that open api expects 3) for parameters, so I tend towards that.

tuurma commented 4 years ago

fixed in 3e1af8389ee471f4a01098026be3586c7c100191