Skip to content

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

One Comment leave one →
  1. april 1, 2011 08.38

    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.

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit / Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit / Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit / Bijwerken )

Google+ photo

Je reageert onder je Google+ account. Log uit / Bijwerken )

Verbinden met %s

%d bloggers op de volgende wijze: