spring mvc - Input an enum value in a form as hidden using thymeleaf -


i fill form input hidden using value of enum:

enum:

public enum tipoendereco {     residencial, comercial } 

summarizing html code, i've tried use form input this:

<input type="hidden" th:field="*{endereco[0].tipoendereco}" th:value="residencial"/> 

but unfortunately, field being recorded null. others fields don't use enum in way, being recorded normal. i've used enum fill option, directly input type hidden isn't working. i'm using thymeleaf.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -