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 2019/03/07 19:01:09 UTC

[myfaces-tobago] branch master updated: TOBAGO-1974: "update" attribute of doesn't work

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new bd946d0  TOBAGO-1974: "update" attribute of <tc:reload> doesn't work
bd946d0 is described below

commit bd946d0f7384a76765a536747b363e2f334d9b62
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Mar 7 20:00:44 2019 +0100

    TOBAGO-1974: "update" attribute of <tc:reload> doesn't work
---
 .../tobago/internal/component/AbstractUIPanel.java | 30 ++++++++++++++++++++++
 .../tobago/internal/component/AbstractUISheet.java | 21 +++++++++++++++
 .../internal/renderkit/renderer/PanelRenderer.java |  8 +++---
 .../internal/renderkit/renderer/SheetRenderer.java |  7 +++--
 .../myfaces/tobago/renderkit/RendererBase.java     | 10 ++++++++
 .../apache/myfaces/tobago/util/ComponentUtils.java | 14 ++++++++++
 .../tobago/example/demo/PanelController.java       |  6 +++++
 .../050-container/20-panel/Panel.xhtml             | 18 +++++++++++++
 .../src/main/npm/js/tobago-myfaces.js              |  8 ++++++
 .../src/main/npm/package.json                      |  2 +-
 .../src/main/npm/ts/tobago-jsf.ts                  | 30 +++++++++++-----------
 .../src/main/npm/ts/tobago-reload.ts               | 30 ++++++++++++++++++++++
 .../src/main/npm/ts/tobago-sheet.ts                | 16 ++++++------
 .../src/main/resources/META-INF/tobago-config.xml  |  1 +
 14 files changed, 168 insertions(+), 33 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPanel.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPanel.java
index 0d5c1f7..9db3a92 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPanel.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPanel.java
@@ -19,10 +19,40 @@
 
 package org.apache.myfaces.tobago.internal.component;
 
+import org.apache.myfaces.tobago.renderkit.RendererBase;
+import org.apache.myfaces.tobago.util.AjaxUtils;
+import org.apache.myfaces.tobago.util.ComponentUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.render.Renderer;
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 
 /**
  * {@link org.apache.myfaces.tobago.internal.taglib.component.PanelTagDeclaration}
  */
 public abstract class AbstractUIPanel extends AbstractUICollapsiblePanel implements ClientBehaviorHolder {
+
+  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  @Override
+  public void encodeAll(FacesContext facesContext) throws IOException {
+
+    final AbstractUIReload reload = ComponentUtils.getReloadFacet(this);
+
+    if (reload != null && AjaxUtils.isAjaxRequest(facesContext) && reload.isRendered() && !reload.isUpdate()) {
+      // do not render content
+      final Renderer renderer = getRenderer(facesContext);
+      if (renderer instanceof RendererBase) {
+        ((RendererBase)renderer).encodeReload(facesContext, reload);
+      } else {
+        LOG.warn("Found reload facet but no renderer support for it id='{}'!", getClientId(facesContext));
+      }
+    } else {
+      super.encodeAll(facesContext);
+    }
+  }
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
index 69ad7bd..0ec30d7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
@@ -36,6 +36,8 @@ import org.apache.myfaces.tobago.layout.ShowPosition;
 import org.apache.myfaces.tobago.model.ExpandedState;
 import org.apache.myfaces.tobago.model.SelectedState;
 import org.apache.myfaces.tobago.model.SheetState;
+import org.apache.myfaces.tobago.renderkit.RendererBase;
+import org.apache.myfaces.tobago.util.AjaxUtils;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,6 +57,7 @@ import javax.faces.event.FacesEvent;
 import javax.faces.event.ListenerFor;
 import javax.faces.event.PhaseId;
 import javax.faces.event.PreRenderComponentEvent;
+import javax.faces.render.Renderer;
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
@@ -88,6 +91,24 @@ public abstract class AbstractUISheet extends AbstractUIData
   private transient Grid headerGrid;
 
   @Override
+  public void encodeAll(FacesContext facesContext) throws IOException {
+
+    final AbstractUIReload reload = ComponentUtils.getReloadFacet(this);
+
+    if (reload != null && AjaxUtils.isAjaxRequest(facesContext) && reload.isRendered() && !reload.isUpdate()) {
+      // do not render content
+      final Renderer renderer = getRenderer(facesContext);
+      if (renderer instanceof RendererBase) {
+        ((RendererBase)renderer).encodeReload(facesContext, reload);
+      } else {
+        LOG.warn("Found reload facet but no renderer support for it id='{}'!", getClientId(facesContext));
+      }
+    } else {
+      super.encodeAll(facesContext);
+    }
+  }
+
+  @Override
   public void encodeBegin(final FacesContext facesContext) throws IOException {
     final SheetState theState = getSheetState(facesContext);
     final int first = theState.getFirst();
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java
index 453f88f..9a7fa75 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/PanelRenderer.java
@@ -19,7 +19,6 @@
 
 package org.apache.myfaces.tobago.internal.renderkit.renderer;
 
-import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.context.Markup;
 import org.apache.myfaces.tobago.internal.component.AbstractUIPanel;
 import org.apache.myfaces.tobago.internal.component.AbstractUIReload;
@@ -48,6 +47,7 @@ public class PanelRenderer extends PanelRendererBase {
     final String clientId = panel.getClientId(facesContext);
     final boolean collapsed = panel.isCollapsed();
     final Markup markup = panel.getMarkup();
+    final AbstractUIReload reload = ComponentUtils.getReloadFacet(panel);
 
     writer.startElement(HtmlElements.DIV);
     writer.writeIdAttribute(clientId);
@@ -66,10 +66,8 @@ public class PanelRenderer extends PanelRendererBase {
       writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
     }
 
-    final UIComponent reloadFacet = ComponentUtils.getFacet(panel, Facets.reload);
-    if (reloadFacet instanceof AbstractUIReload && reloadFacet.isRendered()) {
-      final AbstractUIReload update = (AbstractUIReload) reloadFacet;
-      writer.writeAttribute(DataAttributes.RELOAD, Integer.toString(update.getFrequency()), false);
+    if (reload != null && reload.isRendered()) {
+      writer.writeAttribute(DataAttributes.RELOAD, reload.getFrequency());
     }
 
     writer.writeCommandMapAttribute(JsonUtils.encode(RenderUtils.getBehaviorCommands(facesContext, panel)));
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
index b863e24..5ca86ef 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
@@ -227,6 +227,7 @@ public class SheetRenderer extends RendererBase {
     final String sheetId = sheet.getClientId(facesContext);
     final Markup markup = sheet.getMarkup();
     final TobagoResponseWriter writer = getResponseWriter(facesContext);
+    final AbstractUIReload reload = ComponentUtils.getReloadFacet(sheet);
 
     UIComponent header = sheet.getHeader();
     if (header == null) {
@@ -271,10 +272,8 @@ public class SheetRenderer extends RendererBase {
         TobagoClass.SHEET.createMarkup(markup),
         sheet.getCustomClass(),
         markup != null && markup.contains(Markup.SPREAD) ? TobagoClass.SPREAD : null);
-    final UIComponent facetReload = ComponentUtils.getFacet(sheet, Facets.reload);
-    if (facetReload != null && facetReload instanceof AbstractUIReload && facetReload.isRendered()) {
-      final AbstractUIReload update = (AbstractUIReload) facetReload;
-      writer.writeAttribute(DataAttributes.RELOAD, update.getFrequency());
+    if (reload != null && reload.isRendered()) {
+      writer.writeAttribute(DataAttributes.RELOAD, reload.getFrequency());
     }
 // todo    writer.writeCommandMapAttribute(JsonUtils.encode(RenderUtils.getBehaviorCommands(facesContext, sheet)));
     final CommandMap commands = RenderUtils.getBehaviorCommands(facesContext, sheet);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
index a94ea55..08ea7e4 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
@@ -19,6 +19,7 @@
 
 package org.apache.myfaces.tobago.renderkit;
 
+import org.apache.myfaces.tobago.internal.component.AbstractUIReload;
 import org.apache.myfaces.tobago.internal.webapp.TobagoResponseWriterWrapper;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -31,6 +32,7 @@ import javax.faces.context.ResponseWriter;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
 import javax.faces.render.Renderer;
+import java.io.IOException;
 
 public class RendererBase extends Renderer {
 
@@ -82,4 +84,12 @@ public class RendererBase extends Renderer {
       return new TobagoResponseWriterWrapper(writer);
     }
   }
+
+  /**
+   * Special implementation for the reload facet (e.g. for tc:panel and tc:sheet.
+   */
+  public void encodeReload(FacesContext facesContext, AbstractUIReload reload) throws IOException {
+    final TobagoResponseWriter writer = getResponseWriter(facesContext);
+    writer.write("{\"reload\":{\"frequency\":" + reload.getFrequency() + "}}");
+  }
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
index bc45edd..7588a8b 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
@@ -30,6 +30,7 @@ import org.apache.myfaces.tobago.internal.component.AbstractUIFormBase;
 import org.apache.myfaces.tobago.internal.component.AbstractUIInput;
 import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
 import org.apache.myfaces.tobago.internal.component.AbstractUIPopup;
+import org.apache.myfaces.tobago.internal.component.AbstractUIReload;
 import org.apache.myfaces.tobago.internal.component.AbstractUISheet;
 import org.apache.myfaces.tobago.internal.util.StringUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
@@ -535,6 +536,19 @@ public final class ComponentUtils {
     component.getFacets().remove(facet.name());
   }
 
+  public static AbstractUIReload getReloadFacet(final UIComponent component) {
+    final UIComponent facet = getFacet(component, Facets.reload);
+    if (facet == null) {
+      return null;
+    } else if (facet instanceof AbstractUIReload) {
+      return (AbstractUIReload) facet;
+    } else {
+      LOG.warn("Content of a reload facet must be {} but found {} in component with id '{}'",
+          AbstractUIReload.class.getName(), facet.getClass().getName(), component.getClientId());
+      return null;
+    }
+  }
+
   public static boolean isFacetOf(final UIComponent component, final UIComponent parent) {
     for (final Object o : parent.getFacets().keySet()) {
       final UIComponent facet = parent.getFacet((String) o);
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PanelController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PanelController.java
index 34ed728..72526f4 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PanelController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/PanelController.java
@@ -22,6 +22,7 @@ package org.apache.myfaces.tobago.example.demo;
 import javax.enterprise.context.RequestScoped;
 import javax.inject.Named;
 import java.io.Serializable;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 
 @RequestScoped
@@ -34,6 +35,11 @@ public class PanelController implements Serializable {
     return new Date();
   }
 
+  public boolean isOddDecaSecond() {
+    String second = new SimpleDateFormat("ss").format(getCurrentDate());
+    return second.startsWith("1") || second.startsWith("3") || second.startsWith("5");
+  }
+
   public String getText() {
     return text;
   }
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/20-panel/Panel.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/20-panel/Panel.xhtml
index 7dac913..97e1b83 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/20-panel/Panel.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/050-container/20-panel/Panel.xhtml
@@ -59,6 +59,24 @@
     </tc:panel>
   </tc:section>
 
+  <tc:section label="Reload with update control">
+    <p>To reload the panel in a dedicated frequency, you can use the
+      <code class="language-markup">&lt;f:facet name="reload"></code> tag.
+      The content of the panel is an outputtext, which display the current time.</p>
+    <pre><code class="language-markup">&lt;tc:panel>
+  &lt;f:facet name="reload">
+    &lt;tc:reload frequency="1000" update="\#{panelController.oddDecaSecond}"/>
+      ...</code></pre>
+    <tc:panel>
+      <f:facet name="reload">
+        <tc:reload frequency="1000" update="#{panelController.oddDecaSecond}"/>
+      </f:facet>
+      <tc:out id="r" label="Current Date" value="#{panelController.currentDate}">
+        <f:convertDateTime pattern="HH:mm:ss"/>
+      </tc:out>
+    </tc:panel>
+  </tc:section>
+
   <tc:section label="Ajax">
     <p>A panel can also be useful if more than one component should be rerendered.
       A component for rerendering can be set with the <code>render</code> attribute in the
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js b/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js
index 0bfc4f8..f6dc4f4 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/js/tobago-myfaces.js
@@ -7728,6 +7728,11 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse", _MF_OBJECT, /** @lends myfaces._impl.xhr
                 resultNode = null,
                 pushOpRes = this._Lang.hitch(this, this._pushOperationResult);
 
+// begin TOBAGO-JSF-JS
+            if (cDataBlock.startsWith("{\"reload\"")) {
+                console.debug("Found reload-JSON in response!");
+            } else {
+// end TOBAGO-JSF-JS
             switch (node.getAttribute('id')) {
                 case this.P_VIEWROOT:
 
@@ -7777,6 +7782,9 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse", _MF_OBJECT, /** @lends myfaces._impl.xhr
                     }
                     break;
             }
+// begin TOBAGO-JSF-JS
+            }
+// end TOBAGO-JSF-JS
         }
 
         return true;
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/package.json b/tobago-theme/tobago-theme-standard/src/main/npm/package.json
index 296b7c4..c585069 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/package.json
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/package.json
@@ -25,7 +25,7 @@
     "css-minify": "cleancss --level 1 --source-map --source-map-inline-sources --output css/tobago.min.css css/tobago.css",
     "ts-compile": "tsc",
     "js-transpile": "node node/node_modules/npm/bin/npx-cli.js --package @babel/cli --package @babel/core --userconfig .npmrc babel -d js es6/*.js",
-    "js-minify": "uglifyjs --compress typeofs=false,drop_console=true --mangle --source-map includeSources --output js/tobago.min.js js/tobago-myfaces.js js/tobago-deltaspike.js js/tobago-polyfill.js js/tobago-listener.js js/tobago-core.js js/tobago-dropdown.js js/tobago-calendar.js js/tobago-command.js js/tobago-file.js js/tobago-header-footer.js js/tobago-in.js js/tobago-jsf.js js/tobago-overlay.js js/tobago-panel.js js/tobago-popover.js js/tobago-popup.js js/tobago-select.js js/tobago [...]
+    "js-minify": "uglifyjs --compress typeofs=false,drop_console=true --mangle --source-map includeSources --output js/tobago.min.js js/tobago-myfaces.js js/tobago-deltaspike.js js/tobago-polyfill.js js/tobago-listener.js js/tobago-core.js js/tobago-dropdown.js js/tobago-calendar.js js/tobago-command.js js/tobago-file.js js/tobago-header-footer.js js/tobago-in.js js/tobago-jsf.js js/tobago-overlay.js js/tobago-panel.js js/tobago-popover.js js/tobago-popup.js js/tobago-reload.js js/tobago [...]
     "test": "echo \"Error: no test specified\" && exit 1"
   },
   "devDependencies": {
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts
index f77f962..8c5434f 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-jsf.ts
@@ -57,23 +57,23 @@ Tobago4.Jsf.init = function() {
       console.log("success");
 
       jQuery(event.responseXML).find("update").each(function () {
+
+        let result: string[] = /<!\[CDATA\[(.*)]]>/s.exec(this.innerHTML);
         var id = jQuery(this).attr("id");
-        console.info("Update after jsf.ajax success: id='" + id + "'");
-        if (Tobago4.Jsf.isId(id)) {
-          console.debug("updating id: " + id);
-          Tobago.Listener.executeAfterUpdate(document.getElementById(id));
-        } else if (Tobago4.Jsf.isBody(id)) {
-          console.debug("updating body");
-          // there should be only one element with this class
-          Tobago.Listener.executeAfterUpdate(document.querySelector<HTMLElement>(".tobago-page"));
-/*
-          for (var order = 0; order < Tobago.listeners.afterUpdate.length; order++) {
-            var list = Tobago.listeners.afterUpdate[order];
-            for (var i = 0; i < list.length; i++) {
-              list[i](newElement);
-            }
+        if (result.length === 2 && result[1].startsWith("{\"reload\"")) {
+          // not modified on server, needs be reloaded after some time
+          console.debug("Found reload-JSON in response!");
+          Tobago4.Reload.init(id, JSON.parse(result[1]).reload);
+        } else {
+          console.info("Update after jsf.ajax success: id='" + id + "'");
+          if (Tobago4.Jsf.isId(id)) {
+            console.debug("updating id: " + id);
+            Tobago.Listener.executeAfterUpdate(document.getElementById(id));
+          } else if (Tobago4.Jsf.isBody(id)) {
+            console.debug("updating body");
+            // there should be only one element with this class
+            Tobago.Listener.executeAfterUpdate(document.querySelector<HTMLElement>(".tobago-page"));
           }
-*/
         }
       });
     } else if (event.status === "complete") {
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-reload.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-reload.ts
new file mode 100644
index 0000000..b29fccc
--- /dev/null
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-reload.ts
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Tobago4.Reload = {};
+
+Tobago4.Reload.init = function (id: string, reload: any) { // todo: make a reload object
+  const element = jQuery(document.getElementById(id));
+  element.data("tobago-reload", reload.frequency);
+  if (element.hasClass("tobago-panel")) {
+    Tobago4.Panel.init(element);
+  } else if (element.hasClass("tobago-sheet")) {
+    Tobago4.Sheets.get(id).initReload();
+  } else {
+    console.warn("reload not implemented for this element: " + id);
+  }
+};
diff --git a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-sheet.ts b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-sheet.ts
index 4e28b0d..74ea6a4 100644
--- a/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-sheet.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/npm/ts/tobago-sheet.ts
@@ -93,14 +93,14 @@ Tobago4.Sheet.reloadWithAction = function(elementId) {
   var executeIds = elementId;
   var renderIds = elementId;
   // XXX FIXME: behaviorCommands will probably be empty and not working!
-  if (this.behaviorCommands && this.behaviorCommands.reload) {
-    if (this.behaviorCommands.reload.execute) {
-      executeIds += " " + this.behaviorCommands.reload.execute;
-    }
-    if (this.behaviorCommands.reload.render) {
-      renderIds += " " + this.behaviorCommands.reload.render;
-    }
-  }
+  // if (this.behaviorCommands && this.behaviorCommands.reload) {
+  //   if (this.behaviorCommands.reload.execute) {
+  //     executeIds += " " + this.behaviorCommands.reload.execute;
+  //   }
+  //   if (this.behaviorCommands.reload.render) {
+  //     renderIds += " " + this.behaviorCommands.reload.render;
+  //   }
+  // }
   jsf.ajax.request(
       elementId,
       null,
diff --git a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
index 0b9186b..8ca95a0 100644
--- a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
+++ b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
@@ -80,6 +80,7 @@
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-panel.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-popover.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-popup.js"/>
+          <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-reload.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-select.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-sheet.js"/>
           <script name="/tobago/standard/tobago-bootstrap/${project.version}/js/tobago-split-layout.js"/>