Use of mask for Lookup filtering

I have a lookup field and I want to filter with mask. I’m checking filtering options in LookupField - CUBA Platform. Developer’s Manual but not sure if this allows me to do what I want.

I have a list of numbers, from 0 to 99999999
I want to do something like we do in SQL with LIKE and % char.
If I write 99%99, I filter all values starting with 99 and finishing with 99, with any combination in the middle. Now, What I need is this same idea but using a dot (.) instead of %.

Is this possible?

No sense to filter anything in a lookupField. I think you mean you want to select a certain item from lookupField entering an expression.using a wildcard to be replaced by some calculated string, i.e. “.” to other string

I made it with this WA

LookupField lookupFieldSomething;

public void ready(){
    lookupFieldSomething.setNewOptionHandler(new LookupField.NewOptionHandler() {
        public void addNewOption(String caption) {
            if (caption.contains(".")) {
                MyObject myObject=searchMyObject(caption); //here you will format caption and get myObject, if exists

Hello @giuseppe

The task can be easily solved with SuggestionField component: documentation.

In case of using a dot as mask we can consider a query as RegExp and just filter all available items:

// Declaratively install SearchExecutor for our SuggestionField
@Install(to = "suggestionField", subject = "searchExecutor")
private List suggestionFieldSearchExecutor(String query, Map<String, Object> params) {
    // consider a query with dot "." like regexp
    Pattern likeQuery = Pattern.compile(query);

    // "entities" - CollectionContainer
    return entities.getItems()
            .filter(item -> likeQuery.matcher(item.getName()).matches())



I’ve prepared an example that you can find here: GitHub.


Sorry for late reply Daniil, At the moment was solved using A. Punzi solution, but I will review your share projects, thanks a lot