3 Replies Latest reply on Oct 17, 2005 7:43 PM by Dennis Gesker

    JSF Cast Problem

    Dennis Gesker Newbie

      I am able to populate a report (JSF dataTable) using a method from a Session bean that returns some objects (Person objects) in my persistence archive.

      So far so good but when I click on the commandLink jboss returns a FacesException and indicates, later in the stacktrace that the cause is a ClassCastException.

      The method seems to choke at the line:

      //personModel is a ListDataModel
      Person p = (Person) personModel.getRowData();

      However, other lines I placed (inside System.out statements) in the method are returning what I think are reasonable values:

      personModel.getRowCount() // returns 5 which is correct
      personModel.getRowIndex() // returns the correct index
      personModel.isRowAvailable() //returns true
      personModel.getRowData() // returns com.alamon.ejb.pg_sample_rw.Person@eba477

      If someone in the forum could point me in the right direction I'd be really greatful.

      Thanks
      Dennis