public ProjectCasDoctorPanel(String id, IModel<Project> aProjectModel) { super(id, aProjectModel); setOutputMarkupId(true); Form<FormModel> form = new Form<>("casDoctorForm", PropertyModel.of(this, "formModel")); add(form); CheckBoxMultipleChoice<Class<? extends Repair>> repairs = new CheckBoxMultipleChoice<>( "repairs"); repairs.setModel(PropertyModel.of(this, "formModel.repairs")); repairs.setChoices(CasDoctor.scanRepairs()); repairs.setChoiceRenderer(new ChoiceRenderer<>("simpleName")); repairs.setPrefix("<div class=\"checkbox\">"); repairs.setSuffix("</div>"); repairs.setLabelPosition(LabelPosition.WRAP_AFTER); form.add(repairs); form.add(new LambdaAjaxButton<FormModel>("check", this::actionCheck)); form.add(new LambdaAjaxButton<FormModel>("repair", this::actionRepair)); add(createMessageSetsView()); }
public ProjectCasDoctorPanel(String id, IModel<Project> aProjectModel) { super(id, aProjectModel); setOutputMarkupId(true); Form<FormModel> form = new Form<>("casDoctorForm", PropertyModel.of(this, "formModel")); add(form); CheckBoxMultipleChoice<Class<? extends Repair>> repairs = new CheckBoxMultipleChoice<>( "repairs"); repairs.setModel(PropertyModel.of(this, "formModel.repairs")); repairs.setChoices(CasDoctor.scanRepairs()); repairs.setChoiceRenderer(new ChoiceRenderer<>("simpleName")); repairs.setPrefix("<div class=\"checkbox\">"); repairs.setSuffix("</div>"); repairs.setLabelPosition(LabelPosition.WRAP_AFTER); form.add(repairs); form.add(new LambdaAjaxButton<FormModel>("check", this::actionCheck)); form.add(new LambdaAjaxButton<FormModel>("repair", this::actionRepair)); add(createMessageSetsView()); }