Bruce Stemplewski
Bruce Stemplewski

Reputation: 1343

Getting data from a datasource with Filter by Column Value?

I have a list box where I am trying to get the datafrom the people view in names.nsf.

The first column of the people view is computed and shows Last Name , First Name.

The code below works fine for my list box values but it does not take into consideration the value in the Filter By Column Value. Basiclly the code below acts like the Filter By Column value property does not exist. I know the Filter by Column value property is working because I replaced a repeat control on the page with a computed field and the repeat control is displaying the value excepected but the list box is displaying values from the first document in the view.

Thoughts I had to fix this are:

Use getAllDocumentsByKey to just search the people view but when I do that I lose the column values and I would need to recompute the value, something that I would like to avoid if possible incase the column formula changes.

Use FTSearch but what I really need to do is search that first column only and I am not aware of search operator that searchs a column only. Is there such a thing?

Another thought would be to somehow use the values of a repeat control, as the values for my list box, but I am guessing that this is not possible. I sort of thinking something with a scope varibale but I have not worked that out yet.

A repeat control works. How can I get my code to loop through the doeuments the same way a repeat control does?

And as a side question, is there anyway to tie a pager to a datasource as oppsed to a repeat control.

BTW What I currently do is to build a list box using a few computed fields and a repeat control but what I really want to do is to use a regular xpages list box control.

Here is the code:

  var doc:NotesDocument = view1.getFirstDocument();

while (doc != null && count<10)
{       
    var tmpDoc:NotesDocument = view1.getNextDocument(doc)
    ret.push(doc.getColumnValues()[1]);
    doc.recycle();
    count++;
    doc = tmpDoc;   
}

Upvotes: 0

Views: 648

Answers (1)

W_K
W_K

Reputation: 868

Try to use getAllEntriesByKey. This will give You access to column values (through ColumnValue property of view entry).

Upvotes: 2

Related Questions