atom
atom

Reputation: 191

Lookup for large list on xPage

I have a list of approx 10K entries (and growing) I need to be able to reference in an xPages app. I have had lookup limitations using @DbLookup, so have looked at other options. Unfortunately I continue to run into these limitations.

I am currently loading the lookup list into a session scope variable on page load (which has performance impacts), and the reference the scoped variable for the combo box.

I am using the following simple process to load the list for the combo box. This, however, is also running into limitations.

var lookupView:NotesView = database.getView("LookupView");
sessionScope.lookupList = lookupView.getColumnValues(0) + "|" + lookupView.getColumnValues(4);

I would like a method to perform a lookup that can handle the larger list (main priority) with performance being number 2. The page is used by a limited number of users with the function being most important.

Upvotes: 0

Views: 112

Answers (2)

Frantisek Kossuth
Frantisek Kossuth

Reputation: 3524

I doubt your users want or need to pick some value from combo with 10k+ lines.

Rethink your approach, you can use autocomplete feature with dynamic filter/search in live view (no scoped variable needed), as pointed by Mark. Another approach is to divide that values into some groups and split that combo to two or three with cascading choose/lookup function. First one picks one group, second one looks up only options from first group. That way you probably won't hit that @DbLookup limitations.

Upvotes: 1

Per Henrik Lausten
Per Henrik Lausten

Reputation: 21709

Take a look at this code snippet "Pure Java version of DbLookup & DbColumn, with cache, sort and unique" and either use it directly or use it as inspiration.

You should consider storing the list in application scope since it seems that the list is the same for all users. This means that you need to change the code in the code snippet to use applicationScope instead of sessionScope.

Upvotes: 1

Related Questions