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

RSS Items - Vaadin Add-on Directory

RSS Vaadin Flow component RSS Items - Vaadin Add-on Directory
This component will show every rss item from a rss stream as a clickable thumbnail with a description. It's based on [this web component](https://github.com/TherapyChat/rss-items). #### Found a bug or have a suggestion? Report it on GitHub For bug reports, feature suggestions, or questions, please open an issue on [GitHub](https://github.com/FlowingCode/RssItemsAddon/issues). This makes it easier for us to track and respond efficiently, ensuring you get the best possible support. Your input helps us improve—thank you!
Author Homepage
Source Code
Issue tracker
View on GitHub
Online Demo

RSS Items version 1.0.0
Initial release

RSS Items version 2.0.0
Initial release for Vaadin 14+ NPM Mode

RSS Items version 2.0.1
* Added optional parameter to specify which attribute contains the used in the thumbnails * Corrected rss url for DemoView

RSS Items version 2.0.2
### Bug Fixes: * Bump httpclient from 4.5.6 to 4.5.13 * Default image search fix (fixes [#13](https://github.com/FlowingCode/RssItemsAddon/issues/13))

RSS Items version 2.0.3
#### Bug fixes: * Fix import for Vaadin 23.2 compatibility ([#15](https://github.com/FlowingCode/RssItemsAddon/issues/15))

RSS Items version 2.0.4
#### Bug fixes: * fix: correct import for Vaadin 23.2 compatibility ([#15](https://github.com/FlowingCode/RssItemsAddon/issues/15)) * refactor: replace deprecated PolymerTemplate ([#19](https://github.com/FlowingCode/RssItemsAddon/issues/19))

Online