Directory

← Back

TimerExtension Add-on

A Vaadin add-on that enables component-based polling.

Author

Contributors

Rating

Do you need polling but only as long as a certain component is visible? If so, then the TimerExtension Add-on is the solution for you. Simply start the polling and then either stop the polling manually or just detach the component or a parent of it and the polling stops automatically. The extension is implemented using JavaScript, so no WidgetSet compilation is necessary.

Sample code

final TimerExtension timerExtension = new TimerExtension(extendedComponent);
timerExtension.setIntervalInMs(1000);  // polling interval in milliseconds
timerExtension.addTimerListener(e -> { /* handle polling event */ });
layout.addComponent(extendedComponent);

// ...

timerExtension.start();  // start the polling explicitly, it is stopped when the extended component is detached from the UI

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

This versions is updated to be used with Vaadin 8. For Vaadin 7 use version 0.1.0

Released
2017-03-31
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 8.0+
Vaadin 7.4+ in 0.1.0
Browser
Browser Independent
Online