[jboss-user] [JBoss Seam] - Re: Multiple roles and accessing the DataModel

denis-karpov do-not-reply at jboss.com
Fri Sep 15 03:44:45 EDT 2006


In this case you can use:

yourBean.getYourModel.getRowData();
  | yourBean.getYourModel.getRowIndex();
  | 

But you should not create DataModel each time in a getter.
I use it something like this:
	private DataModel dm = null;
  | 
  | 	public DataModel getDetails() {
  | 		if (dm==null){
  | 			dm = new ListDataModel();
  | 		}
  | 		return dm;
  | 	}
  | 
  | 	private void syncDetails() {
  | 		Client o = getObject();
  | 		if (o!=null){
  | 			getDetails().setWrappedData(o.getDocuments());
  | 		}
  | 	}
  | 
  | 	private IdentityCard getSelectedDocument() {
  | 		return (IdentityCard)getDetails().getRowData();
  | 	}
  | 
Frankly, I do not like
@DataModel
@DataModelSelection
@DataModelSelectionIndex


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

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



More information about the jboss-user mailing list