Strange issue with <select> while doing view / edit / save on the same form

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange issue with <select> while doing view / edit / save on the same form

makdeniss
Hello everyone!

I have a form, where I display / edit / save the value of the select field from the model:

<select class="selectpicker form-control show-menu-arrow"
        data-live-search="true"
        th:field="*{status}"
        th:value="${firm.status}">
   <option value="00" th:text="#{firm.enabled}"></option>
   <option value="01" th:text="#{firm.disabled}"></option>
   <option value="02" th:text="#{firm.agreement.ended}"></option>
   <option value="03" th:text="#{firm.test}"></option>
</select>
The problem is that the correct option isn't displayed, although the firm.status is holding the correct value of 00. Simple <input type="text"/> fields are working.

Maybe somebody had a problem of the same sort and solved it? Thanks in advance.

Kind regards,
Deniss
Reply | Threaded
Open this post in threaded view
|

Re: Strange issue with <select> while doing view / edit / save on the same form

makdeniss
My bad. This code actually works like it should. The database data was changed by somebody and was not consisted with my expectations.

Thanks and kind regards,
Deniss