InputRadioGroup en Jugar 2.2
-
20-12-2019 - |
Pregunta
Me encuentro con un error al compilar estos Código:
@(newStaff: List[staffInfo], newStaffForm: Form[staffInfo])
@import helper._
@main("Simple application") {
@form(routes.Application.newForm()) {
@inputText(newStaffForm("name"))
@inputRadioGroup(
newStaffForm("gender"),
options = Seq("M"->"Male","F"->"Female")
'_label -> "Gender",
'_error -> newStaffForm("gender").error.map(_.withMessage("select gender")))
@inputDate(field = newStaffForm("dateOfBirth"), args = 'size -> 10)
<input type="submit" value="Submit">
}
}
El mensaje de error de compilación: ')' Esperado pero el símbolo literal encontrado. El error se resalta aquí -> '_ etiqueta
¿Alguien sabe cómo resolver este problema?
Solución
Parece que simplemente carece de una coma después de esta línea:
options = Seq("M"->"Male","F"->"Female")
debería ser
options = Seq("M"->"Male","F"->"Female"), //note the comma in the end
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow