0

如何在结果 A 对话表单中使用 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);
}
4

1 回答 1

0

form(T)有方法fill(Object),所以你可以用一些对象填充它

public static Result B() {
    Conversation conversation = Conversation.find.byId(123);
    Form<Conversation> conversationForm = form(Conversation.class).fill(conversation);
    return(abc.render(conversationForm);
}
于 2013-09-25T08:54:25.870 回答