0
我目前正在使用Play框架,但似乎沒有什麼關於表單的信息。玩框架和表格
在我得到的東西,看起來像這樣的時刻: 的路線是:
GET /test controllers.Application.testMethod()
的方法:
public static Result testMethod(){
//handles the Form
}
的NameResidencePair類:
public static class NameResidencePair{
public String name;
public String residence;
}
斯卡拉.html以表格形式提供的網頁
@(aForm: Form[NameResidencePair])
@import helper._
@form(action = routes.Application.testMethod) {
@inputText(
field = userForm("name")
)
@inputText(
field = userForm("residence")
)
}
如果我仍然想要一個表單,但是其中一個值(如居住地)始終是相同的值,該怎麼辦?例如:residence =「在雲上」。我仍然想通過表單傳遞它,但我不想要一個文本框。換句話說,我想通過一個名稱和居住形式,但只有名稱應該是可編輯的,並在輸入字段中可見。