使用键 (Xpages) 获取多类别视图(两个类别)的条目数 [英] Get entries count for a multiple category view (two categories) using a key (Xpages)
问题描述
我正在尝试使用键检索多类别视图(两个类别)的条目数.
I am trying to retrieve the entries count for a multiple category view (two categories) using a key.
var db:NotesDatabase = session.getDatabase(sessionScope.serverPath,sessionScope.dbName);
var luview = db.getView(sessionScope.viewName);
var vec:NotesViewEntryCollection = null;
if (key != null) {
vec = luview.getAllEntriesByKey(key);
}
count = vec.getCount().toFixed()
返回的计数不正确.我在视图中有 500 多个文档.它似乎只返回第一个子类别的文档数 (20).
The count being returned is incorrect. I have over 500 documents in the view. It seems to be returning just the document count (20) of the first sub-category.
我发现在论坛中提到这是一个错误.我在 9.0 服务器上运行它.任何指针将不胜感激.
I've found mention of this as a bug in the forums. I'm running this on a 9.0 server. Any pointers would be much appreciated.
我想要的是总计数 - 类别 (25) + 文档 (500),我可以在重复控制限制中使用.
What I would like is the total count - categories (25) + documents (500), that I can use in the repeat control limit.
谢谢,
丹
推荐答案
我能够通过使用 NotesViewNavigator 解决这个问题.
I was able to resolve this by using the NotesViewNavigator.
var nav:NotesViewNavigator = v.createViewNavFromCategory(key);
var entry:NotesViewEntry = nav.getFirst();
while (entry != null) {
count = count + 1;
var tmpentry:NotesViewEntry = nav.getNext(entry);
entry.recycle();
entry = tmpentry;
}
这篇关于使用键 (Xpages) 获取多类别视图(两个类别)的条目数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!