[jboss-user] [JBoss Seam] - Re: PAGE scope DataModel's selection not correct

Holy Joe do-not-reply at jboss.com
Wed Sep 20 07:11:27 EDT 2006


I made a cheap hack in outjectDataModelList() in Component.java that made things work as I expected (for a page-scoped DataModel in a session-scoped bean).  I changed this:


  |     context.set( name, wrapper.wrap(dataModelAnn, list));
  | 

to this:


  |     if(existingDataModel != null) {
  |         ((javax.faces.model.DataModel) existingDataModel).setWrappedData(list);
  |      } else {
  | 	 context.set( name, wrapper.wrap(dataModelAnn, list));
  |      }
  | 

I don't understand the bigger picture well enough to know if that is going to hurt me in other ways, though.  Will reusing the wrapper cause problems with non-PAGE-scoped DataModels, or perhaps there are other uses of DataModels that will break?  Is it always safe to cast to javax.faces.model.DataModel?

Of course, any advice on how to implement my app without using a page-scoped datamodel in a session-scoped bean is welcome, too.

Thanks,

Joe



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972892#3972892

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972892



More information about the jboss-user mailing list