You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/11/30 14:22:05 UTC

svn commit: r1208413 - in /myfaces/tobago/trunk/tobago-theme: tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/ tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard...

Author: lofwyr
Date: Wed Nov 30 13:22:03 2011
New Revision: 1208413

URL: http://svn.apache.org/viewvc?rev=1208413&view=rev
Log:
javascript: cleanup and docs

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java?rev=1208413&r1=1208412&r2=1208413&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java Wed Nov 30 13:22:03 2011
@@ -83,7 +83,6 @@ without shadow
     writer.writeClassAttribute(Classes.create(box));
     writer.writeIdAttribute(clientId);
     writer.writeStyleAttribute(new Style(facesContext, box));
-    writer.writeJavascript("Tobago.addAjaxComponent(\"" + clientId + "\");");
     encodeBox(facesContext, writer, box);
   }
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=1208413&r1=1208412&r2=1208413&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Nov 30 13:22:03 2011
@@ -744,11 +744,21 @@ var Tobago = {
     }
   },
 
-  addAjaxComponent: function(componentId, containerId) {
-    if (! containerId) {
-      containerId = componentId;
+  /**
+   * Register components which can be updated via ajax.
+   *
+   * Remark: It is no longer needed to register components which can be replaced completely (since 1.5.0), this
+   * was done by leaving the second parameter blank.
+   *
+   * @param componentId Id of the element which can be updated via ajax.
+   * @param container Either a JS-Object which handles the ajax update, or a id of the element which shall be updated, or nothing (deprecated).
+   */
+  addAjaxComponent: function(componentId, container) {
+    if (! container) {
+      LOG.warn('Call of addAjaxComponent() without a container is no longer needed! componentId=' + componentId); // @DEV_ONLY
+    } else {
+      this.ajaxComponents[componentId] = container;
     }
-    this.ajaxComponents[componentId] = containerId;
   },
 
   reloadComponent: function(source, id, actionId, options) {
@@ -1030,7 +1040,6 @@ var Tobago = {
           .after("<div id='" + popupId + "' />");
     }
 
-    Tobago.addAjaxComponent(popupId);
     Tobago.reloadComponent(source, popupId, actionId, options);
   },