Hello everyone,
I have a question about customizing the search behavior in the standard Dropdown Search / Tag widget in OutSystems 11.
My current issue:When I type "338" into a dropdown search/Tag, it returns options where "338" appears anywhere within the full label—for example, both 301-338-809-0 and 301-333-809-0 show up, because the substring "338" or similar sequences are found anywhere inside the label.
What I want:Instead of matching everywhere in the label text, I need the search to match only if one of the blocks separated by hyphens (-) exactly matches the search text.
Example:Given these dropdown options:
If I type 338, only 301-338-809-0 should be shown.If I type 333, only 301-333-809-0 should be shown.
Is it possible to modify or override the default search/filter behavior for Dropdown in OutSystems 11 to support this block-based (exact match per segment) search?Or, has anyone already built or come across a solution for this kind of need?
Any guidance, ideas, or example implementations would be greatly appreciated!
Thank you!
Hi,
please share a small independant oml with this already as a demo in it, that will considerably lower the threshold for people to help.
Hi @Braham ayad
Use Server-Side Dropdown and add your custom filter. Check the below postwe don’t want dropdown search to trim spaces | OutSystems
Thanks,
Sudip
You can achieve this by enabling ServerSideSearch and handling the OnSearch event manually. Then filter the list using: Index("-" + CurrentItem.Label + "-", "-" + SearchText + "-") <> -1 This makes the search match only exact hyphen-separated blocks. Example:
After filtering, assign the filtered list back to the Dropdown ItemList. You can do this either server-side or fully client-side using ListFilter in the OnSearch action. No custom JavaScript needed.