Getting handle to XPages repeat control data in different places
Chris Connor March 4 2011 06:29:23 AM
Needed this kind of functionality in at least a couple of occasions now. You have a view and to that view you bind a repeat control. You then tie a search to the view so you can display searched results in a repeat control. In many circumstances you will want to present further functionality based on the searched data set (perhaps an export to excel or a filtering series of checkboxes or ...well about anything).The key is we need to get a hold of the repeat control, get the underlying data source (searched data - called by getModelData), then the documents "beneath" (from each row by using getRowData()). Well - it is fairly straight forward as below.
var temprows=getComponent("repeat1");
var modelData=temprows.getDataModel();
for(i=0; i < modelData.getRowCount() ; i++){
modelData.setRowIndex(i);
var xspViewEntry=modelData.getRowData();
var document=xspViewEntry.getDocument();
BeanPickerList.setArraylist(document.getItemValueString("Type"));
}
For your information "BeanPickerList" is just a simple ManagedBean that I manipulate in a few places in my application. But the idea is that you get a handle to the NotesDocument. From there you can do anything that you normally do in the Notes world...
Tweet
- Comments [2]

