Directory

← Back

Timer

Client side invisible timer which allows to launch some event on server periodicaly

Author

Rating

Wrapper for GWT Timer.

It allows to schedule some server side event or run it periodically.

Sample code

    @Override
	protected void init(VaadinRequest request) {
		final VerticalLayout layout = new VerticalLayout();
		layout.setMargin(true);
		setContent(layout);

		Timer timer = new Timer();
		
		Button button = new Button("Click Me");
		button.addClickListener(event -> {
			timer.scheduleRepeatable(1000);
		});
		
		timer.run(() -> {
			layout.addComponent(new Label("Thank you for clicking"));
		});
		
		Button cancel = new Button("Cancel timer");
		cancel.addClickListener(event -> {
			timer.cancel();
		});
		
		addExtension(timer);
		layout.addComponent(button);
		layout.addComponent(cancel);
	}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Released
2016-06-20
Maturity
BETA
License
Public Domain

Compatibility

Framework
Vaadin 7.6+
Browser
Browser Independent

Timer - Vaadin Add-on Directory

Client side invisible timer which allows to launch some event on server periodicaly Timer - Vaadin Add-on Directory
Wrapper for GWT Timer. It allows to schedule some server side event or run it periodically.
Online