2

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?

Jeremy Hodge
  • 1,655
  • 9
  • 8
Lothar Mueller
  • 2,528
  • 1
  • 16
  • 29
  • 4
    Having that much data displayed in a comboBox makes for an unpleasant user experience in the browser. Why not use a typeAhead (either out of the box XPage version) or alternate instead to lessen the burden on the server and user? – MarkyRoden May 03 '12 at 13:54
  • Have a look at Domino Access Services (DAS) in Upgrade Pack 1. – Simon O'Doherty May 03 '12 at 19:17
  • @MarkyRoden: you're perfectly right, of course, and I should have pointed out that the combo for the moment is just a starting point; it's what is there at the moment. And meanwhile I also tried a type ahead, but the question still remains: how would I consume a REST service's response in a SSJS computation? – Lothar Mueller May 04 '12 at 10:31
  • 1
    @SimonO'Doherty: I thought about that, but at the moment I can't tell wether the customer's admin staff will allow DAS to be enabled on their server; that's why I first thought about the REST service – Lothar Mueller May 04 '12 at 10:33

1 Answers1

2

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

Sven Hasselbach
  • 10,455
  • 1
  • 18
  • 26
  • Thanks for the idea, I'll give that a try, and probably will stick to that. Still - and be it only for curiosity's sake - I'd like to know wether there **is** a way to consume REST service responses using SSJS coding; and yes: I know that this can be done using a managed bean; I'm more or less trying to get comfortable with REST in that context, and what I can do with it ;) – Lothar Mueller May 04 '12 at 10:37
  • I've been investigating the same problem - accessing REST Services via SSJS. Looking at the kinds of view controls REST Services are available for in the Extension Library, they are only client-side controls - Dojo DataGrid, iNotes views. I suspect the output of the REST Service is not calculated server-side, but only calculated by the browser at runtime. That why I think you can only use client-side results to generate the "repeat". – Paul Stephen Withers May 20 '12 at 10:34
  • Sven, one question. How do you do this, but on different database on the same server? Thank you... – gkidd Jul 20 '12 at 11:05