【问题标题】:@repeat field with error in Form - Play Framework@repeat 表单中有错误的字段 - Play Framework
【发布时间】: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

【问题讨论】:

    标签: playframework-2.0


    【解决方案1】:

    Play 框架论坛的回答:https://groups.google.com/forum/#!topic/play-framework/eE2bpHMVDDg

    It is a bug in Play version 2.2.2 version. The 2.2.3 has fixed :).  Take a look in this pull request => https://github.com/playframework/playframework/pull/2499
    

    【讨论】:

      猜你喜欢
      • 2012-10-05
      • 2015-08-30
      • 2016-02-08
      • 1970-01-01
      • 1970-01-01
      • 2017-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多