summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-05-14 14:15:15 +0300
committerVaadin Code Review <review@vaadin.com>2014-05-15 10:24:10 +0000
commit9bf7fa0d1da706cbb4ae7aa3995c80124954a9ae (patch)
tree069ec73083b06bb1765118077b63a286ea88fdc5 /uitest
parentcfbe3e213efed691cddc5f96cfe900544931658a (diff)
downloadvaadin-framework-9bf7fa0d1da706cbb4ae7aa3995c80124954a9ae.tar.gz
vaadin-framework-9bf7fa0d1da706cbb4ae7aa3995c80124954a9ae.zip
Add refresh method to mini tutorial code
Change-Id: I7d2e00b13d2d0b3e3b0e3c20dd431c77721e7d91
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
index 6a246a1733..952cf8c681 100644
--- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
+++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
@@ -19,6 +19,7 @@ package com.vaadin.tests.minitutorials.v7a1;
import com.vaadin.annotations.PreserveOnRefresh;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
@@ -34,10 +35,20 @@ import com.vaadin.ui.UI;
public class CreatingPreserveState extends UI {
private static int instanceCounter = 0;
+ private final CssLayout content = new CssLayout();
+
@Override
public void init(VaadinRequest request) {
TextField tf = new TextField("Instance #" + (++instanceCounter));
tf.setImmediate(true);
- setContent(new CssLayout(tf));
+
+ content.addComponent(tf);
+ setContent(content);
+ }
+
+ @Override
+ protected void refresh(VaadinRequest request) {
+ content.addComponent(new Label("UI was refreshed @"
+ + System.currentTimeMillis()));
}
}