I can't find any connection between MVC ViewModel and your KO pickers. params.hiddenId is undefined.
<div class="form-group row">
<label asp-for="AllowedCorsOrigins" class="col-sm-3 col-form-label">
@await Html.PartialAsync("Client/Section/Label", "AllowedCorsOrigins")
</label>
<div class="col-sm-9">
<picker param="multipleSelect=true; hiddenId=AllowedCordOrigins" id="AllowedCorsOriginsItems" multiple-select="true" min-search-text="2"
selected-items="@Model.AllowedCorsOrigins" search-input-placeholder="Enter 2 and more characters 1"
selected-items-title="Selected: ">
</picker>
</div>
</div>
You have multiple attributes for picker, but no params attr. What am I missing?
Please, take a look at - Scripts/App/components/Picker.js (https://github.com/skoruba/IdentityServer4.Admin/blob/master/src/Skoruba.IdentityServer4.Admin/Scripts/App/components/Picker.js), there is ViewModel - that contains the list of parameters which are bound with ko properties.
Check method sync that writes current selected item/s to hidden field. - https://github.com/skoruba/IdentityServer4.Admin/blob/master/src/Skoruba.IdentityServer4.Admin/Scripts/App/components/Picker.js#L180-L195
ko.Picker is rendered via tag helper - https://github.com/skoruba/IdentityServer4.Admin/blob/master/src/Skoruba.IdentityServer4.Admin/Helpers/TagHelpers/PickerTagHelper.cs
If you have any questions, let me know.
Thanks!
There was a typo in my imports and the tag helper was not used at all. It works now, thank you.
Most helpful comment
Please, take a look at -
Scripts/App/components/Picker.js(https://github.com/skoruba/IdentityServer4.Admin/blob/master/src/Skoruba.IdentityServer4.Admin/Scripts/App/components/Picker.js), there isViewModel- that contains the list of parameters which are bound with ko properties.Check method
syncthat writes current selected item/s to hidden field. - https://github.com/skoruba/IdentityServer4.Admin/blob/master/src/Skoruba.IdentityServer4.Admin/Scripts/App/components/Picker.js#L180-L195ko.Pickeris rendered via tag helper - https://github.com/skoruba/IdentityServer4.Admin/blob/master/src/Skoruba.IdentityServer4.Admin/Helpers/TagHelpers/PickerTagHelper.csIf you have any questions, let me know.
Thanks!