【发布时间】:2014-05-14 05:10:48
【问题描述】:
当我的表单中有错误时,我的@repeat 字段似乎会重复多次,因为@repeat 块中有不同的表单输入。
@inputText(formUser("birth"), 'label -> "Birth", 'placeholder -> "Birth", 'class -> "datepicker")
@repeat(formUser("places"), min = 1) { stayField =>
<div id="groupLocationField">
@select(formUser(stayField.name.toString + ".place.id"), options(Place.options), 'label -> "Places", '_default -> "--- Choose a country ---")
@inputDate(formUser(stayField.name.toString + ".startDate"), 'label -> "Start Date", 'placeholder -> "Start Date")
@inputDate(formUser(stayField.name.toString + ".endDate"), 'label -> "End Date", 'placeholder -> "End Date")
</div>
}
就我而言,当我的 Birth 输入错误时,我会让每个 stayField 显示 3 次。
有人遇到过这个问题吗?
编辑: 示例:https://github.com/milkeg/PlayFramwork/tree/master/repeatField
编辑 2: 我在 Play Framework 论坛上开始了这个讨论:https://groups.google.com/forum/#!topic/play-framework/eE2bpHMVDDg
【问题讨论】: