spring mvc - Retun list of checkboxes using thymeleaf -
<p th:each="accommodationcategory,accommodationcategorystat : ${accommodationcategorylist}" > <input type="checkbox" th:field="*{accommodationcategorylist[__${accommodationcategorystat.index}__].valid}" /> <label th:text="*{accommodationcategorylist[__${accommodationcategorystat.index}__].name}">label</label> </p>
accommodationcategory class has 2 attribute valid , name. form return list of accommodationcategory. can fill accommodationcategory's valid attribute checkbox, want fill name attribute using ${accommodationcategory.name} not user input. can't fill accommodationcategory's name attribute when post form.
Comments
Post a Comment