From: Marc Englund Date: Wed, 16 Apr 2008 13:55:58 +0000 (+0000) Subject: Action test link added. X-Git-Tag: 6.7.0.beta1~4886 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=87c20114726e29ec515c320e3268d7bbd4413a38;p=vaadin-framework.git Action test link added. svn changeset:4187/svn branch:trunk --- diff --git a/portlet-src/com/itmill/toolkit/demo/PortletDemo.java b/portlet-src/com/itmill/toolkit/demo/PortletDemo.java index 89eff77672..e4089612f3 100644 --- a/portlet-src/com/itmill/toolkit/demo/PortletDemo.java +++ b/portlet-src/com/itmill/toolkit/demo/PortletDemo.java @@ -36,6 +36,7 @@ public class PortletDemo extends Application { Label userInfo = new Label(); Link portletEdit = new Link(); Link portletMax = new Link(); + Link someAction = null; public void init() { main = new Window(); @@ -69,7 +70,7 @@ public class PortletDemo extends Application { public void handleActionRequest(ActionRequest request, ActionResponse response) { - getMainWindow().showNotification("Action received"); + main.addComponent(new Label("Action received")); } @@ -133,6 +134,19 @@ public class PortletDemo extends Application { portletMax.setEnabled(false); } + if (someAction == null) { + url = response.createActionURL(); + try { + someAction = new Link("An action", new ExternalResource(url + .toString())); + main.addComponent(someAction); + } catch (Exception e) { + // Oops + System.err.println("Could not create someAction: " + e); + } + + } + } } }