alexanoid
alexanoid

Reputation: 25790

Vaadin 23 add click listener to TextField component

Is it possible to add ClickListener to a TextField component? I render a read-only TextField in the Grid column component. The column has expandable details. But when I click on TextField there - nothing happens. With help of ClickListener I plan to expand Grid details programmatically.

Upvotes: 2

Views: 806

Answers (1)

Simon Martinelli
Simon Martinelli

Reputation: 36143

Sure you can add any JavaScript listener with this method:

textField.getElement().addEventListener("click", event -> Notification.show("click"));

Upvotes: 4

Related Questions