Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
播放将子类传递给scala模板的框架_Scala_Templates_Frameworks_Playframework 2.2 - Fatal编程技术网

播放将子类传递给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])