diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2010-06-22 10:34:53 +0000 |
---|---|---|
committer | John Alhroos <john.ahlroos@itmill.com> | 2010-06-22 10:34:53 +0000 |
commit | 3fd304bfca0eb72ae0cd29b11ae7b01cbf713ef2 (patch) | |
tree | 2b74832a454ff3b6c7566dcd513edf2a1764f89f /src | |
parent | b8c51727b67c378506a487808c7e4f27962010ed (diff) | |
download | vaadin-framework-3fd304bfca0eb72ae0cd29b11ae7b01cbf713ef2.tar.gz vaadin-framework-3fd304bfca0eb72ae0cd29b11ae7b01cbf713ef2.zip |
Added communication error details to error popup. #4502
svn changeset:13854/svn branch:6.4
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/vaadin/terminal/gwt/client/ApplicationConnection.java | 27 |
1 files 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 += "<h1>" + configuration.getCommunicationErrorCaption() - + "</h1>"; + html.append("<h1>"); + html.append(configuration.getCommunicationErrorCaption()); + html.append("</h1>"); } if (configuration.getCommunicationErrorMessage() != null) { - html += "<p>" + configuration.getCommunicationErrorMessage() - + "</p>"; + html.append("<p>"); + html.append(configuration.getCommunicationErrorMessage()); + html.append("</p>"); } + if (html.length() > 0) { + + // Add error description + html.append("<br/><p><I style=\"font-size:0.7em\">"); + html.append(details); + html.append("</I></p>"); + 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()); } |