@Transactional public Result remove() { // DynamicForm requestData = Form.form().bindFromRequest(); String id = requestData.get("id"); planService.remove(id); return redirect(routes.PlanApp.index()); }
@Transactional public Result register() { // Form<Plan> planForm = Form.form(Plan.class).bindFromRequest(); if (planForm.hasErrors()) { Logger.debug(planForm.errorsAsJson().toString()); return badRequest(); } Plan plan = planForm.get(); planService.register(plan); return redirect(routes.PlanApp.index()); }
public Result index() { Form<Plan> planForm = new Form<Plan>(Plan.class); List<Plan> plans = planService.findAll(); return ok(list.render(plans, planForm)); }