Reputation: 16851
public void onRowSelect(SelectEvent event) {
FacesMessage msg = new FacesMessage("Car Selected", ((Car) event.getObject()).getModel());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
I need to know the following:
Upvotes: 0
Views: 5982
Reputation: 15240
This PrimeFaces Showcase example fully covers these cases:
http://www.primefaces.org/showcase-labs/ui/datatableRowSelectionSingle.jsf
To answer your questions:
car
attribute in your bean inside this method. Make sure getters and setters are available for your car
. Display the car
on your page using an Ajax PPR when the row select event happens.The code in the showcase example I referenced has all the pieces you need to do this.
Upvotes: 1