select 2 multiple selection using background service

Hello,

I have one scenario where I want to load data from a third party api. In the list box till now I have seen the approach, where one has to bind list first and then search is performed on that only.

Is there is a way by which one can load data from background service when user start typing into text box ?


Thanks,

Durgesh.

The AutoComplete widget, which is part of RichWidgets (platform version 10 or lower), or the SearchBaloon widget, which is part of Outsystems_UI (platform version 11) can do that.

You also have a Select2 forge component that supports remote data sets: https://www.outsystems.com/forge/component-overview/982/select2.

Hi Joao,

Thanks for reply.

By using AutoComplete widget, one will be able to select only one value from shown results. Here, I want to select multiple values. 

I tried searchbaloon widget, I added one onchange action where I was giving service call and refreshing record list.

Here, I noticed that many request were going on, even after I stopped to write new letters in the text box (I found this weird)

Do you know the way by one can use AutoComplete widget with multiple selection ? or may be using listbox (but here I don't want to populate list in preparation, want to give service request in background and bind result behind the scenes)

I have tried listbox select 2 with multi select but, onchange associated action gets called only when I select something from result dropdown.

Thanks,

Durgesh.

Hi Durgesh! I'm sorry, but I overlooked the part where you said you wanted to do multiple selection. Both Autocomplete and SearchBaloon are for single selection.

Select2 allows remote datasets, but the OutSystems implementation that was used in the forge component I mentioned doesn't allow it, for the multiple selection variant. It would be possible for you to adapt the Select2 forge component to your use case, but it might not be trivial.

Do you need multiple selection over a very large number of options and that's why you want to use the third party API directly? Would it be viable to obtain all existing values from that API, using a REST web service, and bind those to a local variable that the Select2 component could use?

Thanks Joao for a quick reply.

Yes I do have a huge data set which is actually a combination of state, city name and I don't want to pull these all directly in preparation.

I am on Outsystems 11 environment and looks like select2 forge component does not support it well and might affect other working applications. (here, component support is limited to version 9)

I though It might be possible with SearchBaloon widget and with some JS in action. While implementing this I found that, it gives many unnecessary background requests. Do you know reason behind this ?