From: Matti Tahvonen Date: Tue, 18 Dec 2007 11:11:57 +0000 (+0000) Subject: client now don't make requests if expired or crashed application X-Git-Tag: 6.7.0.beta1~5224 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3db79bd2491bd5a1ffd3e238ae630e3fbbd66760;p=vaadin-framework.git client now don't make requests if expired or crashed application svn changeset:3255/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index 5499924f02..26809b4a15 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -58,6 +58,8 @@ public class ApplicationConnection { private final IView view; + private boolean applicationRunning = false; + /** * True if each Paintable objects id is injected to DOM. Used for Testing * Tools. @@ -82,6 +84,7 @@ public class ApplicationConnection { } makeUidlRequest("repaintAll=1"); + applicationRunning = true; // TODO remove hardcoded id name view = new IView("itmill-ajax-window"); @@ -329,6 +332,7 @@ public class ApplicationConnection { String html = "

" + caption + "

" + message + "

"; new Notification(Notification.DELAY_FOREVER).show(html, Notification.CENTERED, "error"); + applicationRunning = false; } } @@ -400,18 +404,20 @@ public class ApplicationConnection { } public void sendPendingVariableChanges() { - final StringBuffer req = new StringBuffer(); + if (applicationRunning) { + final StringBuffer req = new StringBuffer(); - req.append("changes="); - for (int i = 0; i < pendingVariables.size(); i++) { - if (i > 0) { - req.append("\u0001"); + req.append("changes="); + for (int i = 0; i < pendingVariables.size(); i++) { + if (i > 0) { + req.append("\u0001"); + } + req.append(pendingVariables.get(i)); } - req.append(pendingVariables.get(i)); - } - pendingVariables.clear(); - makeUidlRequest(req.toString()); + pendingVariables.clear(); + makeUidlRequest(req.toString()); + } } private static native String escapeString(String value)