]> source.dussan.org Git - vaadin-framework.git/commitdiff
Action test link added.
authorMarc Englund <marc.englund@itmill.com>
Wed, 16 Apr 2008 13:55:58 +0000 (13:55 +0000)
committerMarc Englund <marc.englund@itmill.com>
Wed, 16 Apr 2008 13:55:58 +0000 (13:55 +0000)
svn changeset:4187/svn branch:trunk

portlet-src/com/itmill/toolkit/demo/PortletDemo.java

index 89eff77672e08d9059da4b2c5ecd2dce1ee7cb6e..e4089612f3c24aed872e05969fa978576258991a 100644 (file)
@@ -36,6 +36,7 @@ public class PortletDemo extends Application {
     Label userInfo = new Label();\r
     Link portletEdit = new Link();\r
     Link portletMax = new Link();\r
+    Link someAction = null;\r
 \r
     public void init() {\r
         main = new Window();\r
@@ -69,7 +70,7 @@ public class PortletDemo extends Application {
         public void handleActionRequest(ActionRequest request,\r
                 ActionResponse response) {\r
 \r
-            getMainWindow().showNotification("Action received");\r
+            main.addComponent(new Label("Action received"));\r
 \r
         }\r
 \r
@@ -133,6 +134,19 @@ public class PortletDemo extends Application {
                 portletMax.setEnabled(false);\r
             }\r
 \r
+            if (someAction == null) {\r
+                url = response.createActionURL();\r
+                try {\r
+                    someAction = new Link("An action", new ExternalResource(url\r
+                            .toString()));\r
+                    main.addComponent(someAction);\r
+                } catch (Exception e) {\r
+                    // Oops\r
+                    System.err.println("Could not create someAction: " + e);\r
+                }\r
+\r
+            }\r
+\r
         }\r
     }\r
 }\r