Scala 斯卡拉和游戏!框架形式错误

Scala 斯卡拉和游戏!框架形式错误,scala,playframework-2.0,Scala,Playframework 2.0,我已经实现了这个表单 val contactForm : Form[Contact] = Form( mapping( "id" -> ignored(NotAssigned: anorm.Pk[Long]), "fax" -> longNumber, "person" ->nonEmptyText, "mobile

我已经实现了这个表单

val contactForm : Form[Contact] = Form(

                 mapping(
                "id" -> ignored(NotAssigned: anorm.Pk[Long]),
                "fax" -> longNumber,
                "person" ->nonEmptyText,
                "mobilePhone" -> longNumber,
                "phone" -> longNumber,
                "email" -> nonEmptyText,
                "supplierId"-> mapping(
                                    "id" -> ignored(NotAssigned: anorm.Pk[Long]),
                                    "identityId" -> mapping(
                                                "id" -> ignored(NotAssigned: anorm.Pk[Long]),
                                                "codiceFornitore" -> number,
                                                "supplierType" -> nonEmptyText,
                                                "ragioneSociale" -> nonEmptyText,
                                                "partitaIva" -> longNumber,
                                                "isProduction" -> boolean //act as boolean 0=FALSE
                                    )(SupplierIdentity.apply)(SupplierIdentity.unapply),
                                    "addressId" ->  mapping(
                                                "id" -> ignored(NotAssigned: anorm.Pk[Long]),
                                                "via" -> nonEmptyText,
                                                "cap" -> number,
                                                "comune" -> nonEmptyText,
                                                "provincia" -> nonEmptyText,
                                                "paese" -> nonEmptyText
                                    )(Address.apply)(Address.unapply),
                                    "userId" -> mapping(
                                            "id" -> ignored(NotAssigned: anorm.Pk[Long]),
                                            "name" -> nonEmptyText
                                    )(User.apply)(User.unapply))
                (Supplier.apply)(Supplier.unapply)          
            )(Contact.apply)(Contact.unapply)   
    )`
其中联系人、供应商身份、供应商、地址和用户为案例类。 这是我的模板

@(supplier: Supplier, contactForm : Form[Contact])
.
.
.
@form(routes.FinanceController.addContact(supplier.id.get)) {



                @helper.input(contactForm("fax"), '_id -> "fax", '_label->"Fax" , '_error -> contactForm.error("fax")) { (id, name, value, args) => 
                <input type="text" id="@id" name="@name" value="" @toHtmlArgs(args)>
                }
                @helper.input(contactForm("person"), '_id -> "person", '_label->"Figura di Riferiment", '_error -> contactForm.error("person")) { (id, name, value, args) => 
                <input type="text" id="@id" name="@name" value="" @toHtmlArgs(args)>
                }
                @helper.input(contactForm("mobilePhone"), '_id -> "mobilePhone", '_label->"Cellulare", '_error -> contactForm.error("mobilePhone")) { (id, name, value, args) => 
                <input type="text" id="@id" name="@name" value="" @toHtmlArgs(args)>
                }
                @helper.input(contactForm("phone"), '_id -> "phone", '_label->"Cellulare", '_error -> contactForm.error("phone")) { (id, name, value, args) => 
                <input type="text" id="@id" name="@name" value="" @toHtmlArgs(args)>
                }
                @helper.input(contactForm("email"), '_id -> "email", '_label->"E-mail", '_error -> contactForm.error("email")) { (id, name, value, args) => 
                <input type="text" id="@id" name="@name" value="" @toHtmlArgs(args)>
                }
                @helper.input(contactForm("supplierId"), '_id -> "supplierId", '_error -> contactForm.error("supplierId")) { (id, name, value, args) => 
                <input type="hidden" id="@id" name="@name" value="@{supplier}" @toHtmlArgs(args)>
                }

            <input type="submit" value="Create">
             }
@(供应商:供应商,联系人表单:表单[联系人])
.
.
.
@表单(routes.FinanceController.addContact(supplier.id.get)){
@helper.input(contactForm(“fax”),“\u id->”fax“,“\u label->”fax“,”\u error->contactForm.error(“fax”){(id、名称、值、参数)=>
}
@helper.input(contactForm(“person”),“\u id->”person“,“\u label->”Figura di-rifiment“,”\u error->contactForm.error(“person”){(id、名称、值、参数)=>
}
@helper.input(contactForm(“mobilePhone”),“\u id->”mobilePhone“,“\u label->”Cellulare“,”\u error->contactForm.error(“mobilePhone”){(id、名称、值、参数)=>
}
@helper.input(contactForm(“电话”),“\u id->”phone“,“\u label->”celllare“,”\u error->contactForm.error(“电话”){(id,name,value,args)=>
}
@helper.input(contactForm(“email”),“\u id->”email“,“\u label->”email“,”\u error->contactForm.error(“email”){(id,name,value,args)=>
}
@helper.input(contactForm(“supplierId”),“\u id->”supplierId“,”\u error->contactForm.error(“supplierId”)){(id,name,value,args)=>
}
}
但当我尝试使用此选项时,会出现以下错误:

列表(FormError(supplierId.identityId.codiceFornitore,error.required,List()), FormError(supplierId.identityId.supplierType,error.required,List()), FormError(supplierId.identityId.RagionSociale,error.required,List()), FormError(supplierId.identityId.partitaIva,error.required,List()), FormError(supplierId.addressId.via,error.required,List()), FormError(supplierId.addressId.cap,error.required,List()), FormError(supplierId.addressId.comune,error.required,List()), FormError(supplierId.addressId.provincia,error.required,List()), FormError(supplierId.addressId.paese,error.required,List()), FormError(supplierId.userId.name,error.required,List())

我真的陷入了这个错误中,我不知道错误在哪里,我没有任何列表


谢谢。

错误消息中的路径表示表单中未考虑的表单元素。例如,错误
FormError(supplierId.identityId.supplierType,error.required,List())
表示视图中的表单没有为Contact.Supplier.SupplierIdentity.supplierType提供值


我怀疑您不想将整个
供应商
包含在您的
联系人
中,只包含ID(因为您调用了
供应商ID
)。我会重新访问您的
表单[Contact]
定义,甚至是
Contact
本身的定义。

我怀疑这一点,问题恰恰是我想包括所有Contact类,但无论如何,谢谢,现在我确切地知道我的问题是什么。