Refresher

Thanks. I added to the ticket. Until a poll listener is added to Vaadin 7, does Refresher 1.2.1.7 not work at all with Vaadin 7.1, or is the issue that it simply doesn’t allow for session timeout, the same as with Vaadin 6?

The issue with Refresher not working with Vaadin 7 is simply that I haven’t ported the code to support Vaadin 7, since the widget structure has changed radically. It shouldn’t be too big of a problem to actually port it, but I just have explicitly not done that work, since having duplicate functionality from both the framework and an add-on isn’t a good idea, imo.

But I can let everyone in on a secret: I’m currently having
a patch
going through into the Vaadin code review process - it’s being targeted to 7.2, so it might appear in a nightly at some point.

Thanks. Unfortunately according to the roadmap, Vaadin 7.2 is set to be released next year. I can’t just stop working for the next four or five months. The best temporary solution I can think of is to periodically update my servers-side UI, which unfortunately means that the information will already be stale by the time the poll happens on some other schedule. :frowning:

Has Refresher been fixed? Is it working on current Vaadin 7 distribution?

The Refresher Add-On itself probably won’t be ported to Vaadin 7 as the poll functionality is now a Core Vaadin7 functionality. If you need poll listeners i suggest trying
this
.

I’m working on a Vaadin 7.1 and Google App Engine project. As noted elsewhere, Vaadin 7.1 push doesn’t work with GAE. However, I have managed to get Refresher to work.

The add-on on the site (v1.2.1.7) has implemented Refresher as an Extension in line with the link in Marius’ previous post.

It works fine with GAE although it regularly throws ConcurrentModificationExceptions. The following small change to the fireRefreshEvents method (synchronizing the listeners list) in the Refresher class fixes that:

private void fireRefreshEvents() {
    List<RefreshListener> syncList = Collections.synchronizedList(refreshListeners);
    for (final RefreshListener listener : syncList) {
        listener.refresh(this);
    }
}

I am submitting this fix for inclusion in the add-on. I also would cast a vote for the add-on not to be retired because it remains the only way to get push functionality for Vaadin under GAE. Hopefully, Push that works everywhere is a future feature of Vaadin.

btw, I am using the functionality to highlight a menuitem the user needs to go to first, when they click on another menuitem. it changes the icon of the menuitem the user needs to go to first and then changes it back. The code is roughly as follows in the View where the menubar is located:

if (wrong menu item pressed) {
otherMenuItem.setIcon(new highlighting image);
refresher.addListener(new Refresher.RefreshListener() {

            @Override
            public void refresh(Refresher source) {
                otherMenuItem.setIcon(original image);
                refresher.removeListener(this);
                refresher.setRefreshInterval(-1);
            }
        });
        refresher.setRefreshInterval(1000);

}

Thanks Jonathan! That looks like a trivial fix indeed. I’ll set a reminder for myself so that I can fix it when I get back home. I’m notoriously bad at maintaining my add-ons once I have published them, but I’ll try to make this contribution upstream this time.

I haven’t checked whether Refresher works with the latest Vaadin version. But since it’s already ported to some earlier version of Vaadin 7, I’ll take a look at that at the same time.

Sorry about the delayed update. Both GitHub and Directory should now be updated with a version of Refresher that has 100% less chances for ConcurrentModificationExceptions!

Reposted a new version for Java 6 compilance.

Hello Henrik
I am having a vaadin application with attached pom.
It was already using touch kit addon <dependency> <groupId>com.vaadin.addon</groupId> <artifactId>vaadin-touchkit-agpl</artifactId> <version>4.0.0.alpha1</version> </dependency>
After adding the refresher addon, some how the UI seems broken, like the combo box missing the arrow and button borders doesnt look right.
what may be the reason for this?

The widget set xml after compilation looks like this [code]

<?xml version="1.0" encoding="UTF-8"?>
<!-- Inherit DefaultWidgetSet -->
<inherits name="com.vaadin.DefaultWidgetSet" />
<inherits name="com.vaadin.addon.touchkit.gwt.TouchKitWidgetSet" />
<inherits name="com.github.wolfie.refresher.RefresherWidgetset" />
[/code] [13566.xml|attachment](upload://AeOdrwvlZF4G0oKMFO6VkqZTwIX.xml) (17.9 KB)

Refersher doesn’t work with Vaadin 7.1 or later; which I’d guess that you’re using if you’re using Touch-Kit 4.0.
Check out this extension instead: https://vaadin.com/wiki/-/wiki/Main/Creating+an+UI+extension

Is there a version of refresher for Vaadin 6.8 but with fix for avoiding concurrentModificationException?

Does Refresher now work with vaadin > 7.1?

In case, please have a look at my problem getting started with refresher:
http://stackoverflow.com/questions/24362405/how-to-use-refresher-addon-in-vaadin

Refresher probably won’t be ported to Vaadin 7 properly as the method used by it doens’t properly work in Vaadin 7 and also isn’t necessary anymore. (Though i’m not the Dev so he might do…)

Better use something like this UI Extension:
https://vaadin.com/wiki/-/wiki/Main/Creating%20an%20UI%20extension

I replied in StackOverflow.

tl;dr. Refresher is now deprecated, since Vaadin 7.2 does everything out-of-the-box.

Thats a pity, refresher still has its use (and we still use it).

The main advantage it has over the UI polling mechanism is that several can be running at the same time, attached to different components (e.g plugins in an app). Each of which can safely stop refreshing independently, without affecting the polling of the others.

You cant do that with UI polling. Its UI-wide, and as such needs managed at a much higher level than the individual components. Obviously being centralised, it means more efficient calls are made to the server than with multiple refreshers. However, both do have their uses.

Could you maybe write a line or two in the directory entry for Refresher to notify about it being deprecated? I actually used it at first instead of the PollListener interface when I converted a Vaadin 6 app to Vaadin 7. :slight_smile:

Yeah, I should’ve done that a good while ago :slight_smile: thanks for reminding me - did that.

Hi, how are you? I’mm having a problem with the add-on refresher, I have two tabs, each one have 2 components updating the data with refresher.
The problem is when I change the tab A to B, in that case, the tab A stops refreshing until the focus returns to it, and the tab B continues refreshing until it loses the focus. Is there any solution to this?.