Reputation: 7176
I changed PrimeFaces JAR library to version 5 from version 2 and now get this exception.
javax.servlet.ServletException: /home.xhtml: The class 'com.primefaces.sample.UserManagedBean' does not have the property 'onUserSelect'. javax.faces.webapp.FacesServlet.service(FacesServlet.java:606) root cause
javax.el.ELException: /home.xhtml: The class 'com.primefaces.sample.UserManagedBean' does not have the property 'onUserSelect'.
xhtm page contains p:datatable
rowSelectListener="#{userManagedBean.onUserSelect}"
rowUnselectListener="#{userManagedBean.onUserUnselect}"
Bean:
public void onUserSelect(SelectEvent event) {
selectedUser = (User) event.getObject();
System.out.println("selectedUser = " + selectedUser);
}
public void onUserUnselect(UnselectEvent event) {
selectedUser = null;
}
So why this doesn't work with PrimeFaces 5 while works with PrimeFaces 2 version?
Upvotes: 0
Views: 474
Reputation: 1069
If you check Primefaces 5 user guide, you'll notice that you cannot find the rowSelectListener
attribute anywhere, but it existed in Primefaces 2. Perhaps you want to take a look at the onRowSelect
and onRowUnselect
listeners of <p:ajax>
events for rowSelect
and rowUnselect
(page 167 of Primefaces 5 user guide). See here also: Primefaces tag rowSelectListener not found.
Upvotes: 3