]> source.dussan.org Git - vaadin-framework.git/commitdiff
multiapp support for JS api (useful in portal with multiple toolkit applications)
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 27 May 2008 10:47:55 +0000 (10:47 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 27 May 2008 10:47:55 +0000 (10:47 +0000)
svn changeset:4646/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java

index bb7436a6aa8b24f54a5b9ec4e49ca83999592b60..00e5a5073875c2d3f1131884a38704abe5d2ac17 100755 (executable)
@@ -181,10 +181,11 @@ public class ApplicationConnection {
     }-*/;
 
     /**
-     * Publishes functions for use from javascript.
+     * Publishes a JavaScript API for mash-up applications.
      * <ul>
      * <li><code>itmill.forceSync()</code> sends pending variable changes, in
-     * effect synchronizing the server and client state.</li>
+     * effect synchronizing the server and client state. This is done for all
+     * applications on host page.</li>
      * </ul>
      * 
      * TODO make this multi-app aware
@@ -192,7 +193,14 @@ public class ApplicationConnection {
     private native void initializeClientHooks()
     /*-{
         var app = this;
+        var oldSync;
+        if($wnd.itmill.forceSync) {
+            oldSync = $wnd.itmill.forceSync;
+        }
         $wnd.itmill.forceSync = function() {
+            if(oldSync) {
+                oldSync();
+            }
             app.@com.itmill.toolkit.terminal.gwt.client.ApplicationConnection::sendPendingVariableChanges()();
         }
     }-*/;