Finishing JSF CRUD application.
download result: https://app.box.com/s/e5hiav8jon4nxlpo6yfb
pom.xml:
<p:column headerText="operation">
<h:form>
<p:commandButton value="edit"
action="#{checkListController.setCheck(check)}" update=":checkForm" />
<p:commandButton value="remove"
action="#{checkListController.remove(check)}" update=":checkTable, :messages" />
</h:form>
</p:column>
CheckListController:
public void remove(Check check) {
checkService.remove(check);
checks = checkService.findAll();
FacesContext.getCurrentInstance().addMessage
(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Check removed!", null));
}
public void remove(Check check) {
checkRepository.delete(check);
}