My project's logic is this.
- I have an
HTML formwith a<select multiple>inside that contains a list ofString - With an Angular.js function I fill a
event-dialog-controller.jsvariable with selectedString - I take that variable called
vm.usernamesand I set it as value of an<input type="hidden"> - I call a
RESTservice with form's data usingSpring Springautomatically converts the input in an object ofEventclass- What I see in the end is that object
My issue is that the field that should get the vm.usernames value is empty in my REST. I checked up if vm.usernames is correct when I call the form (using console.log(vm.usernames)), it's correct.
How could I fix this problem?
HTML code:
<div class="form-group">
<label for="field_attendeestoparse">{{vm.usernames}}</label>
<select class="form-control" multiple ng-model="vm.attendeesToParse" ng-change="vm.selectUsernames(vm.attendeesToParse)"
ng-options="customUser as customUser.username for customUser in vm.customusers | orderBy:'id' ">
</select>
<input class="form-control" type="hidden" name="attendees" id="field_attendees" ng-model="vm.event.attendees" ng-value="vm.usernames" />
</div>
I don't paste here my Angular function because I am sure that it does what it has to do.
A little note. If I use an <input type="text"> with the same attributes as <input type="hidden"> and I insert values from keyboard, it works perfectly. I don't know why that hidden does not send that value.
All the other Event's fields work perfectly.
I know I am missing something, please help me!