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.
Asked
Active
Viewed 261 times
2
-
1You can also use Native Button Renderer (unless you really need a clickable read-only text field). https://vaadin.com/docs/latest/components/grid/flow/#using-renderers-in-columns – Roman Kovařík Aug 22 '22 at 12:27
1 Answers
4
Sure you can add any JavaScript listener with this method:
textField.getElement().addEventListener("click", event -> Notification.show("click"));

Simon Martinelli
- 34,053
- 5
- 48
- 82