Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Clickable Textfield?

Jared Graber
1 decade ago May 07, 2010 4:10pm
Henri Kerola
1 decade ago May 07, 2010 7:21pm

Hi,

Vaadin supports listening click events from layouts, so you can do something like:

VerticalLayout layout = new VerticalLayout();

final TextField textField = new TextField();
layout.addComponent(textField);
layout.addListener(new LayoutClickListener() {

	public void layoutClick(LayoutClickEvent event) {
		if (event.getChildComponent() == textField) {
			System.out.println("clicked the TextField");
		}
	}
});

Note that TextField supports listening the focus and blur events. Depending on your needs, using these listeners might be enough.

-Henri

Jonathan Nash
1 decade ago Mar 07, 2011 8:05pm
Jouni Koivuviita
1 decade ago Mar 08, 2011 6:45am
Jonathan Nash
1 decade ago Mar 10, 2011 4:54pm
Jonathan Nash
1 decade ago Mar 10, 2011 6:29pm
Jonathan Nash
1 decade ago Mar 10, 2011 8:52pm