How to programmatically filter data in a View Control
februari 6, 2011
Most solutions I see are based on a value of a sessionScope variable that is used in All Properties\data\data\keys property of the View Control. I prefer using Xsp classes in this case com.ibm.xsp.model.domino.DominoViewData to directly set the keys.
Here is my solution (onchange event in a Combo Box Control):
var viewPanel:com.ibm.xsp.component.xp.XspViewPanel = getComponent('viewPanel1');
var dominoView:com.ibm.xsp.model.domino.DominoViewData = viewPanel.getData();
var filterValue = getComponent('comboBox1').getValue();
if (filterValue == 'NA') {
filterValue = '';
}
dominoView.setKeys(filterValue);
The search is executed on the first sorted column. If you want to filter on a category name you can also use: dominoView.setCategoryFilter.
Want to learn more: XP852 – Lotus Domino Designer 8.5.2 Basic XPage Applications
Eén reactie
laat een →
You can also filter the data in the View Control with a full text search using “dominoView.setSearch()”. The method uses the Full-text Syntax as argument, see http://www-10.lotus.com/ldd/dominowiki.nsf/dx/full-text-syntax.