In this example we've added the selected-value-encoding="json"
attribute. This means that the selected-value=
attribute is expected to be in JSON that has also been URI encoded with encodeURIComponent()
(or something else that does the same job).
In this case the selected value looks like selected-value="%5B%22Hoki%22%2C%22Gibberfish%22%5D"
Which is a URL Encoded JSON array that is just a list of strings.
["Hoki","Gibberfish"]
This might be less common but you can use selected-value-encoding="json"
in single select mode.
In this case the selected value looks like selected-value="%22Loach%22"
Which is a URL Encoded JSON string.
"Loach"