Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Vaadin 7.6.X push Tomcat 7 Liferay 6.2
Hello,
I'm new in vaadin and liferay. I would like to use the push tchnology.
In liferay 6.2, I change the version of vaadin from 6 to 7.6.1
I have added the jar for the push
I have added the @push annotation
Then i have one button, when I clicked on, a background thread is sleeping then watch a notification.
But Now, I always need to click on a button or anything else to watch the notification.
I think, it's possible to refresh the UI with the push. But I don't know where is the problem
public void buttonClick(ClickEvent event) {
if (event.getButton() == pushButton1) {
new Push1Thread().start();
}
class Push1Thread extends Thread
{
public void run() {
try {
Thread.sleep(5000);
final UI localUi = UI.getCurrent();
localUi.access(new Runnable() {
public void run() {
// Here the UI is locked and can be update
Notification.show("Je suis réveillé push 1", Notification.Type.ERROR_MESSAGE);
}
});
} catch ( InterruptedException e ) {
e.printStackTrace();
}
}
}
Can anyone help me ?
Thanks a lot
Bertrand
Ilia Motornyi
use
localUI.push();
Thank you for your response.
My code is now:
class Push1Thread extends Thread
{
public void run() {
try {
Thread.sleep(5000);
final UI localUi = UI.getCurrent();
localUi.access(new Runnable() {
public void run() {
Notification.show("Je suis réveillé push 1", Notification.Type.ERROR_MESSAGE);
}
});
localUi.push();
} catch ( InterruptedException e ) {
e.printStackTrace();
}
}
}
But it doesn't work. I believed thst we need localUI.push(); was needed if push is manual. But maybe i'm wrong.
i have tested Vaadin application with only Tomcat and it works. I think the problem is coming from the relation betwen Liferay and Vaadin.
I manually update vaadin in Liferay from Vaadin 6 to Vaadin 7 thanks to a wiki. But maybe I need to update more jars ?
thanks for your help