Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当您在 MappedField 实例上调用 'validate' 时,默认生成的字段 FieldErrors 使用 MappedField 类中的 uniqueFieldId 方法实现,它给出的 id 为
<tablename> + "_" + <field name>.
所以
<span class="lift:msg?id=<table name>_<field name>"></span>
我想做同样的事情,但我正在使用 mongo 和记录,但不起作用
有人有什么建议请
Record 中的字段也有一个 uniqueFieldId,但由于 Record 有许多不同的持久性后端,并且不一定是基于表的,因此该值的计算方式不同。在 BaseField 你会找到方法:
override def uniqueFieldId: Box[String] = Full(name+"_id")
其中 name 是您的字段标识符,即:
val myString = new StringField(this,1024)
名称 == 我的字符串