0
我首先想說的是我完全是新玩框架,我從'whereIsMyDipp'的YouTube教程中獲得了這段代碼,但它不工作,我查看了文檔和其他教程,並不能找出這一個。我使用的打版是2.3.6 我試圖創建一個基本的接觸形式使用@helper東西,我得到這個錯誤: 鏈接截圖:http://imgur.com/keKda1G播放框架窗體參數
not found: value contactForm
這裏我的觀點:
@import helper._
@import helper.twitterBootstrap._
@(contactForm: Form[Contact])
@main("wat"){
@helper.form(action = routes.Application.contactSubmit()) {
@helper.inputText(contactForm("fName"))
@helper.inputText(contactForm("lName"))
@helper.inputText(contactForm("phone"))
@helper.inputText(contactForm("email"))
@helper.inputText(contactForm("subject"))
@helper.inputText(contactForm("message"))
}
}
,這裏是相關的操作方法和模型:
public class Contact {
String fName;
String lName;
String phone;
String email;
String subject;
String message;}
final static Form<Contact> contactForm = form(Contact.class);
public static Result ContactUs() {
return ok(ContactUs.render(contactForm));
}
public static Result contactSubmit() {
Form<Contact> filledForm = form(Contact.class).bindFromRequest();
Contact created = filledForm.get();
return ok(submit.render(created));}
是的,我以前有過這樣的方式,並得到同樣的錯誤,把它移到第三行是絕望的行爲。 – Ardarin 2014-11-21 14:26:01