@EventHandler with Lit templates?

Working through upgrading from Polymer to Lit and have found a number of components that use @EventHander to notify the server side.

E.g.

<a href="#" id="[[item.id]]" on-click="removeClicked">[[item.removeLabel]]</a>

and in Java:

@EventHandler
public void removeClicked(@EventData(event.target.id) String id) {
..
}

The Vaadin migration documentation doesn’t seem to provide any details for how to handle this. Anybody else had this scenario?

Hi,
@EventHandler seems to be covered under “Migrate from PolymerTemplate to LitTemplate” of the “Recommended Vaadin 14 to 23 Upgrade Changes” documentation

1 Like

Thanks Tomi. I’d been on that page several times but somehow missed the @EventHandler part. Thanks for pointing it out.