From 3fd304bfca0eb72ae0cd29b11ae7b01cbf713ef2 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Tue, 22 Jun 2010 10:34:53 +0000 Subject: [PATCH] Added communication error details to error popup. #4502 svn changeset:13854/svn branch:6.4 --- .../gwt/client/ApplicationConnection.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 43e861c98e..5f71183c25 100755 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -500,30 +500,37 @@ public class ApplicationConnection { } /** - * Shows the communication error notification. The 'details' only go to the - * console for now. + * Shows the communication error notification. * * @param details * Optional details for debugging. */ private void showCommunicationError(String details) { console.error("Communication error: " + details); - String html = ""; + StringBuilder html = new StringBuilder(); if (configuration.getCommunicationErrorCaption() != null) { - html += "

" + configuration.getCommunicationErrorCaption() - + "

"; + html.append("

"); + html.append(configuration.getCommunicationErrorCaption()); + html.append("

"); } if (configuration.getCommunicationErrorMessage() != null) { - html += "

" + configuration.getCommunicationErrorMessage() - + "

"; + html.append("

"); + html.append(configuration.getCommunicationErrorMessage()); + html.append("

"); } + if (html.length() > 0) { + + // Add error description + html.append("

"); + html.append(details); + html.append("

"); + VNotification n = new VNotification(1000 * 60 * 45); n.addEventListener(new NotificationRedirect(configuration .getCommunicationErrorUrl())); - n - .show(html, VNotification.CENTERED_TOP, - VNotification.STYLE_SYSTEM); + n.show(html.toString(), VNotification.CENTERED_TOP, + VNotification.STYLE_SYSTEM); } else { redirect(configuration.getCommunicationErrorUrl()); } -- 2.39.5