diff options
author | Leif Åstrand <leif@vaadin.com> | 2014-05-14 14:15:15 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-05-15 10:24:10 +0000 |
commit | 9bf7fa0d1da706cbb4ae7aa3995c80124954a9ae (patch) | |
tree | 069ec73083b06bb1765118077b63a286ea88fdc5 /uitest | |
parent | cfbe3e213efed691cddc5f96cfe900544931658a (diff) | |
download | vaadin-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.java | 13 |
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())); } } |