8268

Getting the number of documents returned to from a viewEntry

Question:

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?

Answer1:

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 <a href="http://www.wissel.net/blog/d6plinks/SHWL-7UDMQS" rel="nofollow">selectable using a dropdown</a> - 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 <a href="http://www.wissel.net/blog/d6plinks/SHWL-9BUG9F?Open" rel="nofollow">code</a> for that.

Let us know how it goes

Recommend

  • Set 'From' email address in Lotus Notes when sending via VBA
  • How to show html codes inside TextView or something else on Android?
  • Create a meeting or calendar item using Domino Data Service(REST service)
  • Extract Lotus Notes attachments using VBA
  • “Out of Memory” error in Lotus Notes automation from VBA
  • Error 500: Command not handled exception on ALL XPages
  • Is it possible to programmatically tell Lotus Notes to generate a new secret key?
  • Grails redirect with reverse proxy
  • True privateness in Python
  • Reflection / C# typing errors when publishing an F# class implementing an interface
  • Creating a C++ function that calls other Lua function
  • iOS Localization Doesn't Work with More Than 63 Files
  • why calling cd shell command through system() or execvp() from a child process won't work?
  • How to synchronize jQuery dialog box to act like alert() of Javascript
  • DomPDF {PAGE_NUM} not on first page
  • Using $this when not in object context
  • QLineEdit password safety
  • Javascript simulate pressing enter in input box
  • How do I fake an specific browser client when using Java's Net library?
  • How reduce the height of an mschart by breaking up the y-axis
  • Perl system calls when running as another user using sudo
  • Trying to switch camera back to front but getting exception
  • Importing jscolor library in angular 2
  • Why winpcap requires both .lib and .dll to run?
  • AT Commands to Send SMS not working in Windows 8.1
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • A cron job substitute?
  • Rails 2: use form_for to build a form covering multiple objects of the same class
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Free memory of cv::Mat loaded using FileStorage API
  • Hits per day in Google Big Query
  • Angular 2 constructor injection vs direct access
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • How do I configure my settings file to work with unit tests?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Linking SubReports Without LinkChild/LinkMaster
  • Is it possible to post an object from jquery to bottle.py?
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Programmatically clearing map cache
  • Binding checkboxes to object values in AngularJs