Add-on Directory

← Back

Refresher

A non-visible poller component

Author

Rating

Popularity

<100

Deprecated. Use Vaadin 7 polling instead.

Because of the way Vaadin works, asynchronous UI changes made on the server side (e.g. by a long-duration data processing Thread) aren't reflected to the client side. This component makes it possible to make UI changes, even if the user doesn't start a transaction.

Sample code

public class RefresherUI extends UI {
	
	public class DatabaseListener implements RefreshListener {
		private static final long serialVersionUID = -8765221895426102605L;
		
		@Override
		public void refresh(final Refresher source) {
			if (databaseResult != null) {
				// stop polling
				removeExtension(source);
				
				// replace the "loading" with the actual fetched result
				content.setValue("Database result was: " + databaseResult);
			}
		}
	}
	
	public class DatabaseQueryProcess extends Thread {
		@Override
		public void run() {
			databaseResult = veryHugeDatabaseCalculation();
		}
		
		private String veryHugeDatabaseCalculation() {
			// faux long lasting database query
			try {
				Thread.sleep(6000);
			} catch (final InterruptedException ignore) {
				return "interrupted!";
			}
			return "huge!";
		}
	}
	
	private static final long serialVersionUID = -1744455941100836080L;
	
	private String databaseResult = null;
	private Label content;
	
	@Override
	public void init(final VaadinRequest request) {
		// present with a loading contents.
		content = new Label("please wait while the database is queried");
		addComponent(content);
		
		// the Refresher polls automatically
		final Refresher refresher = new Refresher();
		refresher.addListener(new DatabaseListener());
		addExtension(refresher);
		
		new DatabaseQueryProcess().start();
	}
}

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

No new code, just recompiled in Java 6

Released
2014-03-14
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.1+
Vaadin 7.0+ in 1.2.1.7
Vaadin 6.2+ in 1.1.1
Browser
Internet Explorer
Internet Explorer
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
iOS Browser
Android Browser
Internet Explorer

Cropperjs - Vaadin Add-on Directory

Crop images and use them afterwards Cropperjs - Vaadin Add-on Directory
# Cropper.js for Vaadin 14+ [Cropper.js](https://github.com/fengyuanchen/cropperjs) is a JavaScript library for cropping images in the browser. Now you are able to crop and use those cropped images in your Vaadin 14+ project with this custom add-on. ## Documentation [docs.f0rce.de/cropper](https://docs.f0rce.de/cropper) ## License [MIT License](https://github.com/F0rce/cropper/blob/master/LICENSE)
Author Homepage
Issue tracker
Documentation
View on GitHub

Cropperjs version 1.0.0-Beta
## Initial Beta Release (v1.0.0-Beta) If you find any issues or have a feature request please visit [cropper/issues](https://github.com/f0rce/cropper/issues) on GitHub.

Cropperjs version 1.0.1
## v.1.0.1 [Bug] - fixed a rare occurance of a null pointer exception when trying to get the image as a decoded base64 byte array

Cropperjs version 1.0.2
### 1.0.2 (2022-05-06) ## [Changelog](https://github.com/F0rce/cropper/releases/tag/v1.0.2) If you find this component usefull, I would really appreciate a rating here or a star on the [GitHub Repository](https://github.com/f0rce/cropper). For Issues and Feature Requests please visit [cropper/issues](https://github.com/f0rce/cropper/issues) on GitHub.

Cropperjs version 1.0.3
### 1.0.3 (2023-02-01) ## [Changelog](https://github.com/F0rce/cropper/releases/tag/v1.0.3) If you find this component usefull, I would really appreciate a rating here or a star on the [GitHub Repository](https://github.com/f0rce/cropper). For Issues and Feature Requests please visit [cropper/issues](https://github.com/f0rce/cropper/issues) on GitHub.

Online