JSF Primefaces Datatable ActionLink problems -
prerequisites:
- glasfish 3.1
- jsf 2.1
- primefaces 5.2
user story:
i want implement delete row function on primefaces datatable, delete function has displayed within table.
implementation:
datatable header
<p:datatable value="#{a.list}" var="var"> delete
<p:column headertext="delete"> <p:commandlink value="-" action="#{a.delete(var)}" /> </p:column> delete method in bean
public void delete(something sth) { model.getlist().remove(sth); } outcome:

when hovering on commandlink showing me uniform resource locator localhost/applicationname/#
eclipse giving me facelet validator warning marker syntax error on expressionlanguage code #{a.delete(var)}
question:
what missing in order delete row?
solution:
i have changed commandlink jsf (not primefaces) , got error, method shouldnt void, string after changing , returning null works...
public string delete(something sth) { model.getlist().remove(sth); return null; }
Comments
Post a Comment