Filter field with EnterPressListener similar to TextField

Hi CUBA community,

I’m looking for the possibility to add an EnterPressListener to an field in a filter (similar as for TextField).
The action should then do the search for this filter.


Is there a way to add to the filter field such a listener? I don’t find anything regarding this in the docu or the forum - or is this not possible at all?

Thanks in advance


Unfortunately, you can’t get access to the Search Button, but as a workaround, you can put your filter to the vbox and add ShortcutAction.

For instance:
XML layout:

<vbox id="vbox">
    <filter id="filter"
        <properties include=".*"/>


private VBoxLayout vbox;

private Filter filter;

public void init(Map<String, Object> params) {
    vbox.addShortcutAction(new ShortcutAction("ENTER",
            shortcutTriggeredEvent -> filter.apply(true)));

Hi Roman,

your ‘workaround’ sounds for me as a solution - works perfect.
Thanks a lot.