Sharing new technologies and best practices

 
alt

Chris Connor

 
Follow ChrisJConnor on Twitter
Chat with me

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...

About Me

Java / Web Development consultant with 17 years experience. Focus on XPages, Java / JSF / J2EE, Websphere Portal, Spring / Hibernate, RCP, jQuery, Dojo, RCP, Eclipse, RAD, Phonegap and general Mobile development. Experienced public speaker at several global events.

My day job is building Web applications for my customers using the best technologies for the job. This blog discusses the issues in delivering these modern collaborative solutions.

I am available for hire through my business BSS IT Solutions. We are an IBM Business Partner based in Scotland serving the UK and beyond!