1

This question asks something similar to what I'm about to ask: Count entries in XPages view

Basically, if I provide a Search property for the view, I'll get a subset of the view's total entries. The suggestion in that question is to query the repeat. But in my case, it seems like I can't query the repeat to get the count of entries in the filtered view because I'm using a pager. It only seems to return the number of entries on the current page. Does the view itself not have some mechanism for querying the number of filtered entries? Thanks.

Community
  • 1
  • 1
Reid Rivenburgh
  • 373
  • 1
  • 9
  • On a related note, I would also like to be able to iterate through the filtered view entries, but that may not be possible for the same reasons that getting the count may not be possible. Is that correct? It's too bad that the dominoView itself (the front-end object) doesn't provide access to this data.... – Reid Rivenburgh Jan 11 '16 at 19:41
  • If you really want to iterate through the filtered view entries why don't you execute your "own" FTSearch on the view with SSJS (or Java) and go from there? – Knut Herrmann Jan 11 '16 at 21:49
  • Thanks. I actually was doing that, but it seemed to have problems of its own. Those problems may just be due to executing the FTSearch in the wrong event handler. beforePageLoad? afterPageLoad? I certainly don't want it done every time a pager link is clicked on. I've been going around in circles a bit.... – Reid Rivenburgh Jan 11 '16 at 22:46
  • Here is my related question: http://stackoverflow.com/questions/34640639/xpages-using-a-view-with-ftsearch-applied-as-a-source-to-dynamicviewpanel# (I really am using a repeat; I said a dynamicViewPanel in that question just to keep it simple.) – Reid Rivenburgh Jan 11 '16 at 22:49

1 Answers1

4

Just as a workaround: add an additional repeat control to your XPage and get the number of entries from there

<xp:repeat
    id="repeat1"
    rows="0"
    value="#{view1}">
</xp:repeat>

<xp:text
    escape="true"
    id="computedField1"
    value="#{javascript:getComponent('repeat1').getRowCount() }">
</xp:text>

<xp:viewPanel
    value="#{view1}"
    ...

The repeat control is "invisible" in browser as it's empty. rows="0" means no rows limit.

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67