[jboss-user] [JBoss Seam] - Re: need help using DataModelSelectionIndex

Kragoth do-not-reply at jboss.com
Mon Nov 19 21:45:19 EST 2007


As far as I know or at least as far as I can tell, you cannot have a DataModelSelectionIndex and a DataModelSelection on the same DataModel.

You need to choose, do you want the index or the object.

There really is no point in having the DataModelSelection if you have the index as you can get the selected object using the index.

So up to you, if you need the index then do your lookup with the index value to return the selected object.

Hope that makes sense.

for example.

You wrote:

  | @DataModel(value="myAuditList")
  | private List myAuditList;
  | 		
  | @DataModelSelection(value="myAuditList")
  | private Object[] myAuditListSelection;
  | 		
  | @DataModelSelectionIndex(value="myAuditListSelection")
  | //this is the row number of the underlying collection
  | private int currentRowNum;	
  | 


Change it to:

  | @DataModel(value="myAuditList")
  | private List myAuditList;
  | 		
  | private Object[] myAuditListSelection;
  | 		
  | @DataModelSelectionIndex(value="myAuditListSelection")
  | //this is the row number of the underlying collection
  | private int currentRowNum;	
  | 
  | public Object[] getMyAuditListSelection() {
  |   return myAuditList.get(currentRowNum);
  | }
  | 


That should work.....however I havn't tested this so dont' just copy and paste, but that is the general idea ok.

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

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



More information about the jboss-user mailing list