Getting the number of documents returned to from a viewEntry

199 views Asked by At

I have a panel on which I have defined a Domino view and called it viewEntry and attached it to a view in the current database. In the Data definition I have it set to filter by Category Names, all of which it does very nicely. Now I want to know how many documents the viewEntry contains. As I understand it viewEntry is a NotesXspViewEntry and I should be able to do something like viewEntry.getChildCount(). So I created a computedFiled inside the panelData with the formula viewEntry.getChildCount() but I get the error: Script interpreter error, line=1, col=11: [TypeError] Error calling method 'getChildCount()' on an object of type 'lotus.domino.local.View [Static Java Interface Wrapper, lotus.domino.local.View: lotus.domino.View]'

So I think this is saying that viewEntry is a NotesView not a NotesXspEntry, guess I was wrong. Then the question still is how do I get a handle on the document count returned in the viewEntry?

1

There are 1 answers

2
stwissel On BEST ANSWER

You are aiming one too high....

 NotesView -> ViewControl --> Entries

I wouldn't call the ViewControl "ViewEntry" confuses the matter very much... since it is rather an EntryCollection. The property you are looking for is ViewControl.getRowCount() The ViewControl does't "know" that it gets only a filtered result from the data source, so ViewControl.getRowCount() returns what the datasource delivered to the control.

Be careful: that method can be quite slow if you have lots of data.

Alternate thought (I'm guessing use cases :-) )...

Quite often we see the category being selectable using a dropdown - that might apply to your use case too. A nice "feature" would be to show the number of entries behind the category name. Something like:

   blue (27) | blue
   red (34) | red
   black (345) | black

In this case you want to use a ViewNavigator to retrieve the values upfront. Steal some code for that.

Let us know how it goes