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:

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

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -