My project's logic is this.
- I have an
HTML form
with a<select multiple>
inside that contains a list ofString
- With an Angular.js function I fill a
event-dialog-controller.js
variable with selectedString
- I take that variable called
vm.usernames
and I set it as value of an<input type="hidden">
- I call a
REST
service with form's data usingSpring
Spring
automatically converts the input in an object ofEvent
class- 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!