2 Replies Latest reply on Feb 29, 2008 11:32 AM by Pete Muir

    Data Model Problem

    Seto Kaiba Newbie

      To make use of ajax data scroller, data should be with extended data model. But the default @DataModel won't automatically convert. So I use a session bean to extend the extended data model. But I found that the session bean could be only accessed with Local interface. So it can't be cast to SerializableDataModel. But if I changed it into pojo, the class cast exception won't occur. But to be uniform, I should use EJB3. Can someone help me?

        • 1. Re: Data Model Problem
          Seto Kaiba Newbie
          
                              SerializableDataModel dataModel = (SerializableDataModel) getValue("#{userDataModel}");
          
                              assertEquals(dataModel.getRowCount(), 2);
          
          



          It will cause ClassCastException. But my userDataModel is  a session bean extending SerializableDataModel. So I think the problem is the session bean could be only accessed as the Local interface. So it couldn't be cast as SerializableDataModel. When I changed the session bean into POJO. The problem doesn't exist. But to be uniform, all class should be EJB. So any solution to this?

          • 2. Re: Data Model Problem
            Pete Muir Master

            Not really, assuming there is no interface that represents your DataModel that the interface can extend. Just use a POJO. Or write your own DataBinder.