Playframework 如何使用FormClass?[游戏框架]
如何在会话形式中使用B类结果Playframework 如何使用FormClass?[游戏框架],playframework,playframework-2.0,Playframework,Playframework 2.0,如何在会话形式中使用B类结果 public static Result A() { Form<Conversation> conversationForm = form(Conversation.class).bindFromRequest(); return TODO; } public static Result B() { //I want this //return(abc.render(conversationForm); } 公共静
public static Result A() {
Form<Conversation> conversationForm = form(Conversation.class).bindFromRequest();
return TODO;
}
public static Result B() {
//I want this
//return(abc.render(conversationForm);
}
公共静态结果A(){
Form conversationForm=Form(Conversation.class).bindFromRequest();
返回待办事项;
}
公共静态结果B(){
//我想要这个
//返回(abc.render)(会话形式);
}
表单(T)
有方法填充(对象)
,因此您可以用一些对象填充它
public static Result B() {
Conversation conversation = Conversation.find.byId(123);
Form<Conversation> conversationForm = form(Conversation.class).fill(conversation);
return(abc.render(conversationForm);
}
公共静态结果B(){
Conversation=Conversation.find.byId(123);
表单会话表单=表单(Conversation.class).fill(Conversation);
返回(abc.render)(会话形式);
}