|
I'm new to jsf, and now I have a problem. I use ResultSetDataModel to encapsulate the rs object. There is no problem displaying Dataltable on the jsf page, but I want to click on one of the records and then display the details.
The click action is bound to a select method to determine which record is selected. I only use model.getRowIndex () to get the serial number of the row that was clicked. How can I use model.getRowData () to get other information about this record?
Thank you very much!
public String select () {
ResultSet result2 = (ResultSet) model.getRowData (); // This sentence will be wrong
rowIndex = model.getRowIndex (); // If you just get this number, you can get
return "success";
}
Error message
javax.faces.el.EvaluationException: java.lang.ClassCastException: javax.faces.model.ResultSetDataModel $ ResultSetMap
javax.faces.webapp.FacesServlet.service (FacesServlet.java:225)
I have seen some examples, such as ListDataModel, where a single record is an object in a List, but what is a record in a ResultSet? With the ResultSet object, an error occurs.
Thank you |
|