From bc6a82ea2b31a3b2d0e4c79eec3032878598bf0b Mon Sep 17 00:00:00 2001 From: maxschuster Date: Sun, 11 Oct 2015 20:48:52 +0200 Subject: Fix custom attributes of Link component (#19107) Added the custom attributes href and target to the Link component to match the attribute names used by Link.readDesign() and Link.writeDesign() Change-Id: I7f257fcf89cb78d14d9632aa1be548e92f3010c3 --- server/src/com/vaadin/ui/Link.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'server') diff --git a/server/src/com/vaadin/ui/Link.java b/server/src/com/vaadin/ui/Link.java index b6e127fd38..c100336180 100644 --- a/server/src/com/vaadin/ui/Link.java +++ b/server/src/com/vaadin/ui/Link.java @@ -90,8 +90,8 @@ public class Link extends AbstractComponent { * the Border style of the target window. * */ - public Link(String caption, Resource resource, String targetName, - int width, int height, BorderStyle border) { + public Link(String caption, Resource resource, String targetName, int width, + int height, BorderStyle border) { setCaption(caption); setResource(resource); setTargetName(targetName); @@ -212,12 +212,12 @@ public class Link extends AbstractComponent { public void readDesign(Element design, DesignContext designContext) { super.readDesign(design, designContext); if (design.hasAttr("target")) { - setTargetName(DesignAttributeHandler.getFormatter().parse( - design.attr("target"), String.class)); + setTargetName(DesignAttributeHandler.getFormatter() + .parse(design.attr("target"), String.class)); } if (design.hasAttr("href")) { - setResource(DesignAttributeHandler.getFormatter().parse( - design.attr("href"), Resource.class)); + setResource(DesignAttributeHandler.getFormatter() + .parse(design.attr("href"), Resource.class)); } } @@ -236,6 +236,9 @@ public class Link extends AbstractComponent { Collection a = super.getCustomAttributes(); a.add("target-name"); a.add("resource"); + // Add custom attributes, see #19107 + a.add("target"); + a.add("href"); return a; } } -- cgit v1.2.3