We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
I have an issue with the code below:
`
<tr th:each="course : ${department.courses}"> <th th:text="${course.id}"></th> <th th:text="${course.title}"></th> <th th:text="${course.mandatory}"></th> <th th:text="${course.duration}"></th> <th th:text="${course.credits}"></th> <th> <div class="form-check"> <label class="form-check-label" for="checkboxCourses"></label> <input id="checkboxCourses" type="checkbox" class="form-check-input" th:value="${course.id}" th:field="*{courses}" th:checked="${course.mandatory}" /> </div> </th> </tr> </tbody>`
I want the checkbox to be checked when a course is mandatory.
The th:field="*{courses}" refers to a Student model, which has a many-to-many relationship with the Course model.
th:field="*{courses}"
I noticed that the th:checked="${course.mandatory}" works when I didn't have the th:field, but then I can't bind the course.id to save it in DB.
th:checked="${course.mandatory}"
th:field
Any ideas?
PS: I want to be checked and disabled.
The text was updated successfully, but these errors were encountered:
yap @eventoul
I have the same issue but I manage it using the following
<input id="checkboxCourses" type="checkbox" class="form-check-input" th:value="${course.id}" name="courses" th:checked="${course.mandatory}" />
There is an assumption that course.mandatory variable value is "selected"
Sorry, something went wrong.
No branches or pull requests
Hi!
I have an issue with the code below:
`
I want the checkbox to be checked when a course is mandatory.
The
th:field="*{courses}"
refers to a Student model, which has a many-to-many relationship with the Course model.I noticed that the
th:checked="${course.mandatory}"
works when I didn't have theth:field
, but then I can't bind the course.id to save it in DB.Any ideas?
PS: I want to be checked and disabled.
The text was updated successfully, but these errors were encountered: