Skip to content

Instantly share code, notes, and snippets.

@Felipe00
Last active October 15, 2015 19:57
Show Gist options
  • Save Felipe00/070773e01855114d233c to your computer and use it in GitHub Desktop.
Save Felipe00/070773e01855114d233c to your computer and use it in GitHub Desktop.
Select with Enum Options
//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>
}
public enum LocalType {
PREFEITURA(1), CAMARA(2);
public final int id;
LocalType(int id) {
this.id = id;
}
}
@Felipe00
Copy link
Author

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