播放将子类传递给scala模板的框架
嘿,我正在尝试从子类创建表单:播放将子类传递给scala模板的框架,scala,templates,frameworks,playframework-2.2,Scala,Templates,Frameworks,Playframework 2.2,嘿,我正在尝试从子类创建表单: models.Incident.report 看起来是这样的: public class Incidet{ public class Report{ } } 我正在传递给scala模板 Form<Incident.Report> filled_form = form(Incident.Report.class).bindFromRequest(); return ok(filterForm.render()); 我得到一个错误: Comp
models.Incident.report
看起来是这样的:
public class Incidet{
public class Report{
}
}
我正在传递给scala模板
Form<Incident.Report> filled_form = form(Incident.Report.class).bindFromRequest();
return ok(filterForm.render());
我得到一个错误:
Compilation error
type Report is not a member of object models.Incident
请提供帮助在Scala中,嵌套类使用
#
运算符进行寻址。所以正确的语法是:
@(filtrForm: Form[models.Incident#Report])
谢谢这很有帮助。现在我需要为内部类创建一个构造函数。
@(filtrForm: Form[models.Incident#Report])