Directory

← Back

digitalclock

Vaadin Digital Clock

Author

Rating

Popularity

<100

The client-side widget, after instantiation, maintains 2 GWT timer objects. One timer is scheduled to fetch the server time every 5 minutes from the web-app server. The other timer is scheduled to execute every second to keep the client-side clock ticking.

The information (or STATE) that is transferred between the client-side widget & the server-side component is a long variable called "time" which holds the current server time in milliseconds.

GWT RPC is used in the background to invoke the piece of code in the server-side component that actually calculates the current server time.

Sample code

public class DigitalclockUI extends UI {

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

		layout.addComponent(new DigitalClock());
	}

}

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
2013-03-30
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.0+
Browser
Browser Independent

digitalclock - Vaadin Add-on Directory

Vaadin Digital Clock digitalclock - Vaadin Add-on Directory
The client-side widget, after instantiation, maintains 2 GWT timer objects. One timer is scheduled to fetch the server time every 5 minutes from the web-app server. The other timer is scheduled to execute every second to keep the client-side clock ticking. The information (or STATE) that is transferred between the client-side widget & the server-side component is a long variable called "time" which holds the current server time in milliseconds. GWT RPC is used in the background to invoke the piece of code in the server-side component that actually calculates the current server time.
Online