0
I wanted to have a dynamic form where the only thing asked is the selection of a user u from a list of users passed to the model from a controller, the email and status fields should be automatically displayed depending on the user who is selected.
the user object has the following class:
public class Utilizador{
private String perfil;
private String email;
private string estado;
...
}
the form elements are organised as follows::
<dl th:class="form-group">
<dt>perfil:</dt>
<dd>
<select class="form-control" th:field="*{hhFrom}">
<option th:each=" u : ${utilizadores}" th:value=""
th:text="${u.perfil}">Options
</option>
</select>
</dd>
<dt>email:</dt>
<dd th:text="${u.email}></dd>
<dt>estado:</dt>
<dd th:text="${u.estado}></dd>
</dl>
I am aware that th:text="${u.email} and th:text="${u.status} are pointing p to a user-like object that is not visible where it is, but my goal was to get around this problem in some way.