From 022ba858dc59a3537d63f794fb201a36342eb68a Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 12 Dec 2011 13:03:23 +0000 Subject: Fix #7965 and #7996 - input fields in tables lose their focus in IE svn changeset:22380/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 553934bf98..1a5156087a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -6676,7 +6676,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, Element focusedElement = Util.getIEFocusedElement(); if (Util.getPaintableForElement(client, getParent(), focusedElement) == this) { // ..in that case, steal the focus back to the focus handler - // but not if focus is in a child component instead (#7965) + // but not if focus is in a child component instead (#7956) focus(); return; } -- cgit v1.2.3 From 238865a4f9c9c7df4fa750e46c280c5e5d59e5f8 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 12 Dec 2011 13:08:43 +0000 Subject: Fixed typo in comment #7965 #7996 svn changeset:22382/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 1a5156087a..553934bf98 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -6676,7 +6676,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, Element focusedElement = Util.getIEFocusedElement(); if (Util.getPaintableForElement(client, getParent(), focusedElement) == this) { // ..in that case, steal the focus back to the focus handler - // but not if focus is in a child component instead (#7956) + // but not if focus is in a child component instead (#7965) focus(); return; } -- cgit v1.2.3 From 983e1fa38e28d4ff3af09946607ef1f71a9025c7 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Fri, 16 Dec 2011 11:43:08 +0000 Subject: #8143 Enable using a completely different implementation for VConsole svn changeset:22419/svn branch:6.7 --- .../vaadin/terminal/gwt/client/ApplicationConfiguration.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index a60fb808a1..15a33e8970 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -450,8 +450,12 @@ public class ApplicationConfiguration implements EntryPoint { // Prepare VConsole for debugging if (isDebugMode()) { Console console = GWT.create(Console.class); - console.setQuietMode(isQuietDebugMode()); - console.init(); + if (console instanceof VDebugConsole) { + // Methods from VDebugConsole not present in Console + VDebugConsole vDebugConsole = (VDebugConsole) console; + vDebugConsole.setQuietMode(isQuietDebugMode()); + vDebugConsole.init(); + } VConsole.setImplementation(console); } else { VConsole.setImplementation((Console) GWT.create(NullConsole.class)); @@ -507,9 +511,9 @@ public class ApplicationConfiguration implements EntryPoint { }-*/; /** - * Checks whether debug logging should be quiet + * Checks whether debugging should be quit * - * @return true if debug logging should be quiet + * @return true if debug should be quiet */ public native static boolean isQuietDebugMode() /*-{ -- cgit v1.2.3 From 848c00331dd0c726b165af44cc3b0de6e327de29 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Fri, 16 Dec 2011 11:47:28 +0000 Subject: Fix some typos (#8143) svn changeset:22421/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 15a33e8970..5782a0b822 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -511,9 +511,9 @@ public class ApplicationConfiguration implements EntryPoint { }-*/; /** - * Checks whether debugging should be quit + * Checks whether debug logging should be quiet * - * @return true if debug should be quiet + * @return true if debug logging should be quiet */ public native static boolean isQuietDebugMode() /*-{ -- cgit v1.2.3 From 780a2098cbd96a8befe35a4676bfe49a01a704f4 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 16 Dec 2011 11:58:58 +0000 Subject: #8040 test case and fix svn changeset:22422/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 553934bf98..d77507084d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -4052,15 +4052,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, reactLastRow = totalRows - 1; } if (lastRendered < reactFirstRow || firstRendered > reactLastRow) { - /* - * #8040 - scroll position is completely changed since the - * latest request, so request a new set of rows. - * - * TODO: We should probably check whether the fetched rows match - * the current scroll position right when they arrive, so as to - * not waste time rendering a set of rows that will never be - * visible... - */ + // #8040 - scroll position is completely changed + // TODO: should probably be done earlier rowRequestHandler.setReqFirstRow(reactFirstRow); rowRequestHandler.setReqRows(reactLastRow - reactFirstRow + 1); rowRequestHandler.deferRowFetch(1); -- cgit v1.2.3 From a79c9749fc0adea7c5ed7163d210c501984b05e9 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 16 Dec 2011 12:47:56 +0000 Subject: #8040 Improved comment svn changeset:22424/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index d77507084d..553934bf98 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -4052,8 +4052,15 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, reactLastRow = totalRows - 1; } if (lastRendered < reactFirstRow || firstRendered > reactLastRow) { - // #8040 - scroll position is completely changed - // TODO: should probably be done earlier + /* + * #8040 - scroll position is completely changed since the + * latest request, so request a new set of rows. + * + * TODO: We should probably check whether the fetched rows match + * the current scroll position right when they arrive, so as to + * not waste time rendering a set of rows that will never be + * visible... + */ rowRequestHandler.setReqFirstRow(reactFirstRow); rowRequestHandler.setReqRows(reactLastRow - reactFirstRow + 1); rowRequestHandler.deferRowFetch(1); -- cgit v1.2.3 From b8f9716602d8107542f0bba9b75ee440c38267a3 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 22 Dec 2011 12:52:13 +0000 Subject: Fix #8170: Window.attach() did not call attach() for subwindows svn changeset:22471/svn branch:6.7 --- src/com/vaadin/ui/Window.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index 5f6c29f182..661174ca85 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -2380,4 +2380,15 @@ public class Window extends Panel implements URIHandler, ParameterHandler, } } + /** + * Notifies the child components and subwindows that the window is attached + * to the application. + */ + @Override + public void attach() { + super.attach(); + for (Window w : subwindows) { + w.attach(); + } + } } -- cgit v1.2.3 From f4dd777d871553606968ee103b1cc0416401a49a Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 22 Dec 2011 14:14:05 +0000 Subject: #8170: Symmetrically with attach(), Window.detach() should call detach() for subwindows svn changeset:22472/svn branch:6.7 --- src/com/vaadin/ui/Window.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index 661174ca85..7e33f91d31 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -2391,4 +2391,17 @@ public class Window extends Panel implements URIHandler, ParameterHandler, w.attach(); } } + + /** + * Notifies the child components and subwindows that the window is detached + * from the application. + */ + @Override + public void detach() { + super.detach(); + for (Window w : subwindows) { + w.detach(); + } + } + } -- cgit v1.2.3 From 551880e879017cd75cf1897ec3b5b2ab35f11bda Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 12 Jan 2012 10:48:04 +0000 Subject: #8085 Recalculate DateField width when enabled state changes svn changeset:22603/svn branch:6.7 --- WebContent/VAADIN/themes/reindeer-tests/styles.css | 8 -------- src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java | 4 ---- 2 files changed, 12 deletions(-) (limited to 'src') diff --git a/WebContent/VAADIN/themes/reindeer-tests/styles.css b/WebContent/VAADIN/themes/reindeer-tests/styles.css index 243d1b87d4..5ce51c919e 100644 --- a/WebContent/VAADIN/themes/reindeer-tests/styles.css +++ b/WebContent/VAADIN/themes/reindeer-tests/styles.css @@ -19,11 +19,3 @@ .v-readonly.v-datefield-enabled-readonly-styled .v-datefield-button { display: none; } - -.popup-style .v-datefield-calendarpanel-header, -.v-datefield-popup-popup-style .v-datefield-calendarpanel-time { - background: red; -} -.popup-style .v-datefield-calendarpanel-body { - background: yellow; -} diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java index 549248aab3..08e5328b40 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java @@ -225,10 +225,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, } if (lastReadOnlyState != readonly || lastEnabledState != isEnabled()) { - // Enabled or readonly state changed. Differences in theming might - // affect the width (for instance if the popup button is hidden) so - // we have to recalculate the width (IF the width of the field is - // fixed) updateWidth(); } -- cgit v1.2.3 From 58c5732531666bb24722cb507607bc55a26a690f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 12 Jan 2012 14:25:07 +0000 Subject: #8085 Do not calculate a fixed width when enabled or readonly status changes if the width for the component is undefined svn changeset:22610/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java | 4 ++++ src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java index 08e5328b40..549248aab3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java @@ -225,6 +225,10 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, } if (lastReadOnlyState != readonly || lastEnabledState != isEnabled()) { + // Enabled or readonly state changed. Differences in theming might + // affect the width (for instance if the popup button is hidden) so + // we have to recalculate the width (IF the width of the field is + // fixed) updateWidth(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java index 56cdf05ddb..ee5503376e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java @@ -392,10 +392,10 @@ public class VTextualDate extends VDateField implements Paintable, Field, * automatically adjusted by the browser. */ public void updateWidth() { - if (isUndefinedWidth()) { + if (!needLayout) { return; } - needLayout = true; + fieldExtraWidth = -1; iLayout(true); } -- cgit v1.2.3 From 62e3341e68278435984165ad10a07504a6ab949e Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 12 Jan 2012 15:51:58 +0000 Subject: Fix for #8241: Provide a way to redirect the client to a given URI in a UIDL response (e.g. a custom login page) svn changeset:22619/svn branch:6.7 --- .../terminal/gwt/client/ApplicationConnection.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 944d9b5974..88f55bf24b 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -97,9 +97,9 @@ public class ApplicationConnection { public static final String ATTRIBUTE_ERROR = "error"; /** - * A string that, if found in a non-JSON response to a UIDL request, will - * cause the browser to refresh the page. If followed by a colon, optional - * whitespace, and a URI, causes the browser to synchronously load the URI. + * A string that, if found in a non-JSON response to a UIDL request, + * followed by a colon, optional whitespace, and a URI, will cause the + * browser to synchronously load the URI. * *

* This allows, for instance, a servlet filter to redirect the application @@ -110,12 +110,12 @@ public class ApplicationConnection { * if (sessionExpired) { * response.setHeader("Content-Type", "text/html"); * response.getWriter().write( - * myLoginPageHtml + "<!-- Vaadin-Refresh: " + * myLoginPageHtml + "<!-- Vaadin-Redirect: " * + request.getContextPath() + " -->"); * } * */ - public static final String UIDL_REFRESH_TOKEN = "Vaadin-Refresh"; + public static final String UIDL_REDIRECT_TOKEN = "Vaadin-Redirect"; // will hold the UIDL security key (for XSS protection) once received private String uidlSecurityKey = "init"; @@ -544,13 +544,13 @@ public class ApplicationConnection { * the request and served non-UIDL content (for * instance, a login page if the session has expired.) * If the response contains a magic substring, do a - * synchronous refresh. See #8241. + * synchronous redirect to the given URI. See #8241 */ - MatchResult refreshToken = RegExp.compile( - UIDL_REFRESH_TOKEN + "(:\\s*(.*?))?(\\s|$)") + MatchResult redirectUri = RegExp.compile( + UIDL_REDIRECT_TOKEN + ":\\s*(.*?)(\\s|$)") .exec(response.getText()); - if (refreshToken != null) { - redirect(refreshToken.getGroup(2)); + if (redirectUri != null) { + redirect(redirectUri.getGroup(1)); return; } } -- cgit v1.2.3 From f3f5f0ebff01df7aa22177629bbac45d4e157243 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 13 Jan 2012 12:14:00 +0000 Subject: #8241 Rename Vaadin-Redirect to Vaadin-Refresh, make URI optional: if not given, refresh the current page svn changeset:22625/svn branch:6.7 --- .../terminal/gwt/client/ApplicationConnection.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 88f55bf24b..0bb311600c 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -97,9 +97,9 @@ public class ApplicationConnection { public static final String ATTRIBUTE_ERROR = "error"; /** - * A string that, if found in a non-JSON response to a UIDL request, - * followed by a colon, optional whitespace, and a URI, will cause the - * browser to synchronously load the URI. + * A string that, if found in a non-JSON response to a UIDL request, will + * cause the browser to refresh the page. If followed by a colon, optional + * whitespace, and a URI, causes the browser to synchronously load the URI. * *

* This allows, for instance, a servlet filter to redirect the application @@ -110,12 +110,12 @@ public class ApplicationConnection { * if (sessionExpired) { * response.setHeader("Content-Type", "text/html"); * response.getWriter().write( - * myLoginPageHtml + "<!-- Vaadin-Redirect: " + * myLoginPageHtml + "<!-- Vaadin-Refresh: " * + request.getContextPath() + " -->"); * } * */ - public static final String UIDL_REDIRECT_TOKEN = "Vaadin-Redirect"; + public static final String UIDL_REFRESH_TOKEN = "Vaadin-Refresh"; // will hold the UIDL security key (for XSS protection) once received private String uidlSecurityKey = "init"; @@ -544,13 +544,15 @@ public class ApplicationConnection { * the request and served non-UIDL content (for * instance, a login page if the session has expired.) * If the response contains a magic substring, do a - * synchronous redirect to the given URI. See #8241 + * synchronous refresh. */ - MatchResult redirectUri = RegExp.compile( - UIDL_REDIRECT_TOKEN + ":\\s*(.*?)(\\s|$)") + MatchResult refreshToken = RegExp.compile( + UIDL_REFRESH_TOKEN + "(:\\s*(.*?))?(\\s|$)") .exec(response.getText()); - if (redirectUri != null) { - redirect(redirectUri.getGroup(1)); + if (refreshToken != null) { + redirect(refreshToken.getGroup(2)); + VConsole.log("*** REDIRECT : " + + refreshToken.getGroup(2)); return; } } -- cgit v1.2.3 From 988107060ad42f274d5e9f7c24b43ce6d33eb5c7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 13 Jan 2012 16:06:02 +0000 Subject: Test and fix for #5982 - FormLayout now updates caption style names when the component is updated svn changeset:22631/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java index 174e66b7aa..5f2884391f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java @@ -327,8 +327,7 @@ public class VFormLayout extends SimplePanel implements Container { } private void setStyles(String[] styles) { - String styleName = CLASSNAME; - + String style = CLASSNAME; if (styles != null) { for (String style : styles) { if (ApplicationConnection.DISABLED_CLASSNAME.equals(style)) { @@ -340,8 +339,7 @@ public class VFormLayout extends SimplePanel implements Container { styleName += " " + CLASSNAME + "-" + style; } } - - setStyleName(styleName); + setStyleName(style); } public void updateCaption(UIDL uidl) { -- cgit v1.2.3 From 369635cb8912f9b0ee52471f0a6f95cc0705ea8d Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 16 Jan 2012 12:10:25 +0000 Subject: #5982 Add the "v-disabled" class name as-is also in addition to prefixed to make generic v-disabled rules work svn changeset:22640/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java index 5f2884391f..174e66b7aa 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java @@ -327,7 +327,8 @@ public class VFormLayout extends SimplePanel implements Container { } private void setStyles(String[] styles) { - String style = CLASSNAME; + String styleName = CLASSNAME; + if (styles != null) { for (String style : styles) { if (ApplicationConnection.DISABLED_CLASSNAME.equals(style)) { @@ -339,7 +340,8 @@ public class VFormLayout extends SimplePanel implements Container { styleName += " " + CLASSNAME + "-" + style; } } - setStyleName(style); + + setStyleName(styleName); } public void updateCaption(UIDL uidl) { -- cgit v1.2.3 From 8ef6c40e9fbc198157ddd4528801caaf752c9bbd Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 16 Jan 2012 12:18:40 +0000 Subject: #8085 Do not calculate a fixed width when enabled or readonly status changes if the width for the component is undefined svn changeset:22642/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java index ee5503376e..56cdf05ddb 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java @@ -392,10 +392,10 @@ public class VTextualDate extends VDateField implements Paintable, Field, * automatically adjusted by the browser. */ public void updateWidth() { - if (!needLayout) { + if (isUndefinedWidth()) { return; } - + needLayout = true; fieldExtraWidth = -1; iLayout(true); } -- cgit v1.2.3 From 7115e50f3286c830fd390acfc5ef52cc52a98a9a Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 20 Jan 2012 13:07:40 +0000 Subject: #8241 Removed debug message, added reference to ticket svn changeset:22736/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/ApplicationConnection.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 0bb311600c..944d9b5974 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -544,15 +544,13 @@ public class ApplicationConnection { * the request and served non-UIDL content (for * instance, a login page if the session has expired.) * If the response contains a magic substring, do a - * synchronous refresh. + * synchronous refresh. See #8241. */ MatchResult refreshToken = RegExp.compile( UIDL_REFRESH_TOKEN + "(:\\s*(.*?))?(\\s|$)") .exec(response.getText()); if (refreshToken != null) { redirect(refreshToken.getGroup(2)); - VConsole.log("*** REDIRECT : " - + refreshToken.getGroup(2)); return; } } -- cgit v1.2.3 From 0f7bf07b0a332cc6b5cb698b5575358b46579670 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 27 Jan 2012 13:10:57 +0000 Subject: #6902 Table empties field on Layout.replaceComponent svn changeset:22788/svn branch:6.7 --- .../terminal/gwt/client/ui/VScrollTable.java | 12 ++++++ .../table/TextFieldValueGoesMissing.html | 47 ++++++++++++++++++++++ .../table/TextFieldValueGoesMissing.java | 10 +++-- 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 553934bf98..f7d23d4453 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -2592,6 +2592,17 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, break; } break; + case Event.ONCONTEXTMENU: + if (client.hasEventListeners(VScrollTable.this, + HEADER_CLICK_EVENT_ID)) { + // Prevent showing the browser's context menu when there is + // a right click listener. + event.preventDefault(); + } + break; + case Event.ONDBLCLICK: + fireHeaderClickedEvent(event); + break; case Event.ONTOUCHMOVE: case Event.ONMOUSEMOVE: if (dragging) { @@ -4736,6 +4747,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, Paintable paintable = client.getPaintable(uidl); paintable.updateFromUIDL(uidl, client); } + pendingComponentPaints.clear(); } } diff --git a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html new file mode 100644 index 0000000000..4573cf4c50 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.html @@ -0,0 +1,47 @@ + + + + + + +TextFieldValueGoesMissing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TextFieldValueGoesMissing
open/run/com.vaadin.tests.components.table.TextFieldValueGoesMissing?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]73,10
enterCharactervaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]test
clickvaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]
contextmenuvaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]
assertValuevaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]test
+ + diff --git a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java index 254f1b0a90..f3ff5e983e 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java +++ b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java @@ -17,11 +17,15 @@ public class TextFieldValueGoesMissing extends TestBase { final Label label1 = new Label("1"); final Label label2 = new Label("2"); - Button button = new Button("Refresh"); + Button button = new Button("Replace label"); button.addListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { - verticalLayout.replaceComponent(label1, label2); + if (verticalLayout.getComponentIndex(label1) > -1) { + verticalLayout.replaceComponent(label1, label2); + } else { + verticalLayout.replaceComponent(label2, label1); + } } }); verticalLayout.addComponent(button); @@ -41,7 +45,7 @@ public class TextFieldValueGoesMissing extends TestBase { @Override protected String getDescription() { - return "Enter a text in the TextField in the table and press the 'replace label' button. This replaces the label which is in the same layout as the table but should not cause the TextField in the table to lose its contents"; + return "Enter a text in the TextField in the table and press the 'Replace label' button. This replaces the label which is in the same layout as the table but should not cause the TextField in the table to lose its contents"; } @Override -- cgit v1.2.3 From 15bceb7d5958326b2747ad191332af56bb1677ec Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 27 Jan 2012 13:50:35 +0000 Subject: Comment improvements related to #6718 svn changeset:22794/svn branch:6.8 --- .../terminal/gwt/client/ui/VCalendarPanel.java | 31 ++++++++++++++-------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java index 3b74232112..fb5070d9a2 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java @@ -72,7 +72,7 @@ public class VCalendarPanel extends FocusableFlexTable implements /** * FocusChangeListener is notified when the panel changes its _focused_ - * value. It can be set with + * value. */ public interface FocusChangeListener { void focusChanged(Date focusedDate); @@ -191,21 +191,22 @@ public class VCalendarPanel extends FocusableFlexTable implements } /** - * Sets the focus to given day of current time. Used when moving in the - * calender with the keyboard. + * Sets the focus to given date in the current view. Used when moving in the + * calendar with the keyboard. * * @param date - * The day number from by Date.getDate() + * A Date representing the day of month to be focused. Must be + * one of the days currently visible. */ - private void focusDay(Date day) { + private void focusDay(Date date) { // Only used when calender body is present if (resolution > VDateField.RESOLUTION_MONTH) { if (focusedDay != null) { focusedDay.removeStyleDependentName(CN_FOCUSED); } - if (day != null && focusedDate != null) { - focusedDate.setTime(day.getTime()); + if (date != null && focusedDate != null) { + focusedDate.setTime(date.getTime()); int rowCount = days.getRowCount(); for (int i = 0; i < rowCount; i++) { int cellCount = days.getCellCount(i); @@ -213,7 +214,7 @@ public class VCalendarPanel extends FocusableFlexTable implements Widget widget = days.getWidget(i, j); if (widget != null && widget instanceof Day) { Day curday = (Day) widget; - if (curday.getDate().equals(day)) { + if (curday.getDate().equals(date)) { curday.addStyleDependentName(CN_FOCUSED); focusedDay = curday; focusedRow = i; @@ -227,9 +228,12 @@ public class VCalendarPanel extends FocusableFlexTable implements } /** - * Sets the selection hightlight to a given date of current time + * Sets the selection highlight to a given day in the current view * * @param date + * A Date representing the day of month to be selected. Must be + * one of the days currently visible. + * */ private void selectDate(Date date) { if (selectedDay != null) { @@ -1526,6 +1530,9 @@ public class VCalendarPanel extends FocusableFlexTable implements } + /** + * A widget representing a single day in the calendar panel. + */ private class Day extends InlineHTML { private static final String BASECLASS = VDateField.CLASSNAME + "-calendarpanel-day"; @@ -1672,6 +1679,8 @@ public class VCalendarPanel extends FocusableFlexTable implements if (day != null) { Date date = day.getDate(); int id = date.getDate(); + // Zero or negative ids map to days of the preceding month, + // past-the-end-of-month ids to days of the following month if (date.getMonth() < displayedMonth.getMonth()) { id -= DateTimeService.getNumberOfDaysInMonth(date); } else if (date.getMonth() > displayedMonth.getMonth()) { @@ -1744,8 +1753,8 @@ public class VCalendarPanel extends FocusableFlexTable implements return time.ampm.getElement(); } if (subPart.startsWith(SUBPART_DAY)) { - // can be less than 1 or greater than the number of days in the current month - // these map to the "off-month" days + // Zero or negative ids map to days in the preceding month, + // past-the-end-of-month ids to days in the following month int dayOfMonth = Integer.parseInt(subPart.substring(SUBPART_DAY .length())); Date date = new Date(displayedMonth.getYear(), -- cgit v1.2.3