Last active
October 15, 2015 19:57
-
-
Save Felipe00/070773e01855114d233c to your computer and use it in GitHub Desktop.
Select with Enum Options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//LocalType é um ENUM com 2 valores | |
@form(routes.LocalController.newLocal(), 'class -> "col s12") { | |
<select id="type" name="type" required> | |
@for(lType <- LocalType.values()){ | |
<option value="@lType.toString"> | |
@lType.toString | |
</option> | |
} | |
</select> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum LocalType { | |
PREFEITURA(1), CAMARA(2); | |
public final int id; | |
LocalType(int id) { | |
this.id = id; | |
} | |
} |
Eu coloquei mas não funcionou. Resolvi passando uma String para a propriedade Value do Select
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Faltou o '@' em localForm.apply("type").value