Can I use a REST service to populate a computed <selectItems> control using SSJS?
-
05-06-2021 - |
سؤال
On an Xpage I'm having this comboBox which gets its values using a classic SSJS @DbColumn
call. There's a chance, however, that the amount of data could exceed the limitations of @DbColumn
. So maybe a REST service could be the solution for me no ?
I found numerous examples for CSJS (re-directing to display a JSON tree, or use a dojoStore from the client), but none that would call a REST service and consume its JSON response right on the server using SSJS code. Is this something that cannot be done, or is it so simple that no-one ever bothered to bring up an example? Or am I maybe completely off-track with my RESTful idea?
المحلول
I share the opinion of MarkyRoden, but just to give you an alternative for @DbColumn(), you could use SSJS instead. Then you won't get an "infinite" result:
var lookupView:NotesView = database.getView("<LOOKUPVIEW>");
lookupView.getColumnValues(0)
This is equivalent to
@DbColumn( "","<LOOKUPVIEW>", 1 );
but brings you the full result w/o the limit.
Hope this helps
Sven