Get rid of “Infinity” as the result of a @DbColumn in a combobox – Quicktip

Who has not experienced the following:

XPages has a 32 or 64 ( can’t remember which ) limit for the lookup formula whereas in Notes the limit is only for the whole of the formula e.g. after @unique is applied.

It makes it very hard to have meaningful drop downs for filtering data.

Instead you can use SSJS e.g.:

var lookupView:NotesView = database.getView(“<LOOKUPVIEW>”);
lookupView.getColumnValues(0)

This is the equivalent to:

@DbColumn( “”,”<LOOKUPVIEW>”, 1 );

and returns you the full result without the limit.

But this also brings me to the following problem:

When I enable Select2 on a loooong combobox the list is populated the type-ahead / filtering works fine BUT when I select a value long down the list the response of the select2 combobox becomes really sloooow.

Does anyone has an approach to this?

2 thoughts on “Get rid of “Infinity” as the result of a @DbColumn in a combobox – Quicktip

  1. Paul Withers (@PaulSWithers) 2017-March-15 / 11:02 am

    I’ve not really used the Select2 control, mainly because for combo/typeahead my preference before the Extension Library was Dojo FilteringSelect and since then my preference has mainly been for the Value Picker (the apps are heavily aimed at desktop users). FilteringSelect allows paging, I investigated and documented it in the Dojo controls chapter of Extension Library book. The Value Picker search functionality helps filter down to a manageable quantity, particularly with the enhancements I contributed for more recent releases of Extension Library.

    Does Select2 provide any such paging functionality? Or would the recommendation from Bootstrap developers be that Select2 should not be used for long lists, in preference to some other component?

    Combobox-style components seem best suited where there are more than 2 – 3 options and less than about 20.

  2. DavidLeedy (@DavidLeedy) 2017-March-15 / 4:07 pm

    I assume the answer is to use the “remote data” option from select2. I’ve never actually done it though. You’d need to get the list back via a REST service and json first I’m sure, rather then internal objects.

Leave a comment