4

I'm aware that the SSJS version of @DbColumn() has the same 64k limitiation as the original Formula language version. So up until now I used NotesView.getColumnValues() instead, believing that here I wouldn't face such a limitation.

Which obviously is wrong as an urgent support call yesterday tells me, as well as this crash report by IBM.

The code in question is used to populate the selectItems control in a comboBox; opening the page hosting the comboBox crashes the server's http task and then in consequence the entire server:

<xp:selectItems>
    <xp:this.value><![CDATA[#{javascript:database.getView("vwInvBySupplier").getColumnValues(0);}]]>
    </xp:this.value>
</xp:selectItems>

This is looking up all category entries from a view. I'm using the combo as a dynamic category filter to the view displayed on the same page.

What alternatives are there to retrieve the complete list of all category entries from the view, even if the data retrieved exceed 64k?

Sidenotes:

I'm fully aware that showing over 2000 entries in a comboBox might not be a convincing usability concept for some, but the customer loves to be able to see all available entries in one place, and then being able to select from that list. At least the standard solution with a view panel full of category entries, twisties, and the need to step through numerous pages is not a solution.

The application is running on Domino 9.0.1, WinSrv 2008/64k

Lothar Mueller
  • 2,528
  • 1
  • 16
  • 29

1 Answers1

5

Luckily, an JavaScript array is not limited to 64K.

  • Create an array var values = [];,
  • "walk" through view with view navigator and add entry values to array with values.push("new value"),
  • return values
Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • 1
    As an alternative, you can use a special Java class for DbColumn and DbLookup from XSnippet: http://openntf.org/XSnippets.nsf/snippet.xsp?id=pure-java-version-of-dblookup-dbcolumn-with-cache-sort-and-unique – Knut Herrmann Apr 24 '14 at 15:13
  • thanks for both inputs; I just copied the data down to my own test server; can't risk to crash the customer's server too often ;) Tomorrow I'll giv both versions a try - What's really disturbing me though is the fact that just by using that function I can crash the Domino server, and that I can't find anything about a limitation to the function I used, apart from IBM's crash report. – Lothar Mueller Apr 24 '14 at 15:38
  • 1
    I think, the limiting factor are the original Notes functions on deepest level. That's why you can't trick them. You're right, it's really bad, that Domino server crashes. But, you have the chance with Java or JavaScript to collect the data on your own. – Knut Herrmann Apr 24 '14 at 15:43
  • I tested the Java version, and it works like a charm. So I implemented it for all the views, even if they don't have that issue. Only drawback is that it for some reason can't properly handle for a multi-value column that is set to "show multiple values as separate entries", it returns arrays instead. But that can be handled. Many thanks again! – Lothar Mueller Apr 25 '14 at 13:08
  • 1
    just for info: I added my array handling solution as a comment to the Snippet code (comment #2; the first on was too complicated...) – Lothar Mueller Apr 25 '14 at 15:37