Adding extra information to events from client-side?

I have a server-side key-down event-handler on a textfield where I want that current client-side value in the field. What is the best way to do this?

Use-case is that I have my own ComboBox-like field.
When down-arrow is pressed, I show a Popover with a grid, filtered against the textfield.
Initially the textfield has valueChangedMode ON_BLUR, so when I get the KeyDownEvent I don’t have the current client-side value

This should work:

textfield.getElement().addEventListener("keydown", event -> {
    var value = event.getEventData().getString("element.value");
    System.out.println("Value: " + value);
}).setFilter("event.key === 'ArrowDown'").addEventData("element.value");

Thanks, that does work :smile:

I had hoped for something cleaner though. Something where I could piggyback on textField.addKeyDownListener and only do addEventData(“element.value”) on that.