【发布时间】:2011-12-05 18:04:50
【问题描述】:
我正在使用Play! Framework 1.2.3、CRUD 模块和 Java
假设我有这个代码:
@Entity
public class Foo extends Model {
}
@Entity
public class Bar extends Model {
public Foo foo;
}
Foo 类有自己的模板布局(位于 views/Foo/show.html)。这同样适用于 Bar 类:
<!-- Bars/show.html -->
#{form action:@save(object._key()), enctype:'multipart/form-data'}
#{crud.form fields:['foo']}
#{/crud.form}
...
但是,我想编辑 html 中的 'foo' 字段。
我发现 #{include} 是这样的:
#{include "Foos/show.html"/}
但我得到一个错误:
NullPointerException : Cannot get property 'type' on null object.
看了这个link我试过了:
#{include "Foos/show.html" arg:'object.foo'/}
但是玩!给我错误:
unexpected token: arg
有没有人成功尝试生成 html 来更改内联字段内容?
【问题讨论】:
标签: java templates playframework