2012-07-13 55 views

回答

4

請參閱從例子中的代碼更新對象

public static Result update(Long id) { 
    Form<Computer> computerForm = form(Computer.class).bindFromRequest(); 
    if(computerForm.hasErrors()) { 
     return badRequest(editForm.render(id, computerForm)); 
    } 
    computerForm.get().update(id); 
    flash("success", "Computer " + computerForm.get().name + " has been updated"); 
    return GO_HOME; 
} 

整個樣本的播放目錄中或可github

相關問題