logo

JSF & PrimeFaces & Spring tutorial 16: complete JSF CRUD application

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);
}

comments powered by Disqus

rss

Free online Java web application examples

Want to develop whole web applications which use database, security and more? See my github account, where are lot's of example projects:
github

Search