inputradiogroup在play 2.2中
-
20-12-2019 - |
题
我在编译这些代码时遇到错误:
@(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">
}
}
.
编译错误消息:')'预期,但符号文字找到。 此处突出显示该错误 - > '_标签
任何人都知道如何解决这个问题?
解决方案
似乎你在这一行之后缺乏逗号:
options = Seq("M"->"Male","F"->"Female")
.
应该是
options = Seq("M"->"Male","F"->"Female"), //note the comma in the end
. 不隶属于 StackOverflow