From 8e83c36157bbdcd0a7baa8cce33c9dd151392470 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Tue, 11 Sep 2012 12:10:18 +0300 Subject: Fixed ComponentLocator to check for null paths. (fix for broken BooleanTextField test) --- client/src/com/vaadin/client/ComponentLocator.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/src/com/vaadin/client/ComponentLocator.java b/client/src/com/vaadin/client/ComponentLocator.java index 68c97badfb..1852b67260 100644 --- a/client/src/com/vaadin/client/ComponentLocator.java +++ b/client/src/com/vaadin/client/ComponentLocator.java @@ -197,7 +197,12 @@ public class ComponentLocator { * If everything else fails we use the DOM path to identify the target * element */ - return path + getDOMPathForElement(targetElement, w.getElement()); + String domPath = getDOMPathForElement(targetElement, w.getElement()); + if (domPath == null) { + return path; + } else { + return path + domPath; + } } /** @@ -498,9 +503,9 @@ public class ComponentLocator { // VVerticalLayout and 0 String[] split = part.split("\\[", 2); String widgetClassName = split[0]; - String indexString = split[1]; - int widgetPosition = Integer.parseInt(indexString.substring(0, - indexString.length() - 1)); + String indexString = split[1].substring(0, + split[1].length() - 1); + int widgetPosition = Integer.parseInt(indexString); // AbsolutePanel in GridLayout has been removed -> skip it if (w instanceof VGridLayout -- cgit v1.2.3