Here is my code
<div class="panel-body">
<div id="pickList">
<div class="row">
<div class="col-sm-5">
<select class="form-control pickListSelect pickListResult"
style="width: 100%" multiple="multiple" id="existingAdminGroupMembers" th:field="*{adminGroup.members}">
<!-- <option
th:each="currentUser : ${add_user.adminGroup.currentMembers}"
th:value="${currentUser}" th:text="${currentUser}"></option> -->
</select>
</div>
<div class="col-sm-2 pickListButtons">
<button class="pAdd btn btn-primary btn-sm">></button>
<button class="pAddAll btn btn-primary btn-sm">>></button>
<button class="pRemove btn btn-primary btn-sm"><</button>
<button class="pRemoveAll btn btn-primary btn-sm"><<</button>
</div>
<div class="col-sm-5">
<select class="form-control pickListSelect pickData"
style="width: 100%" multiple="multiple" id="availableMembersForAdminGrp">
<option
th:each="adminUser : ${add_user.adminGroup.availableMembers}"
th:value="${adminUser.userName}"
th:text="${adminUser.userName}"></option>
</select>
</div>
</div>
</div>
</div>
public class Group {
private String groupName;
private List<User> availableMembers = new ArrayList<User>();
private List<String> currentMembers = new ArrayList<String>();
private String[] members;
}
public class AddUser {
private String clusterName;
private String projectName;
private Group adminGroup;
private Group userGroup;
}
Controller Class :
model.addAttribute("add_user", addUser);
When I am trying to return model attribute back to the controller class using Post method, I am not able to retrieve data of the pickListResult from the th:field adminGroup.members .can you tell me what's the problem in the above code.