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 2016/10/06 07:39:10 UTC

svn commit: r1763508 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/ tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/50-progress/ tobago-theme/tobago-theme-standard/src/m...

Author: lofwyr
Date: Thu Oct  6 07:39:10 2016
New Revision: 1763508

URL: http://svn.apache.org/viewvc?rev=1763508&view=rev
Log:
TOBAGO-1524: Use standard AJAX mechanism
* cleanup

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/FacesContextUtils.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/50-progress/progress.xhtml
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/FacesContextUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/FacesContextUtils.java?rev=1763508&r1=1763507&r2=1763508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/FacesContextUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/FacesContextUtils.java Thu Oct  6 07:39:10 2016
@@ -32,7 +32,6 @@ import java.util.Set;
 public final class FacesContextUtils {
 
   private static final String TOBAGO_AJAX = "org.apache.myfaces.tobago.ajax";
-  private static final String TOBAGO_AJAX_COMPONENT_ID = "org.apache.myfaces.tobago.ajaxComponentId";
   private static final String TOBAGO_ENCTYPE = "org.apache.myfaces.tobago.enctype";
   private static final String TOBAGO_SCRIPT_FILES = "org.apache.myfaces.tobago.scriptFiles";
   private static final String TOBAGO_STYLE_FILES = "org.apache.myfaces.tobago.styleFiles";
@@ -57,14 +56,6 @@ public final class FacesContextUtils {
     return (String) context.getAttributes().get(TOBAGO_FOCUS_ID);
   }
 
-  public static String getAjaxComponentId(final FacesContext context) {
-    return (String) context.getAttributes().get(TOBAGO_AJAX_COMPONENT_ID);
-  }
-
-  public static void setAjaxComponentId(final FacesContext context, final String ajaxComponentId) {
-    context.getAttributes().put(TOBAGO_AJAX_COMPONENT_ID, ajaxComponentId);
-  }
-
   public static String getEnctype(final FacesContext context) {
     return (String) context.getAttributes().get(TOBAGO_ENCTYPE);
   }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/50-progress/progress.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/50-progress/progress.xhtml?rev=1763508&r1=1763507&r2=1763508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/50-progress/progress.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/020-output/50-progress/progress.xhtml Thu Oct  6 07:39:10 2016
@@ -60,7 +60,7 @@
     <p>In this example, the current time is displayed as progressbars.</p>
     <pre><code
             class="language-markup">&lt;tc:progress value="\#{progressController.currentHours}" max="23"/></code></pre>
-    <tc:panel>
+    <tc:panel id="reloadPanel">
       <f:facet name="reload">
         <tc:reload frequency="1000" update="true"/>
       </f:facet>

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java?rev=1763508&r1=1763507&r2=1763508&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java Thu Oct  6 07:39:10 2016
@@ -22,7 +22,6 @@ package org.apache.myfaces.tobago.render
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.UIPanel;
 import org.apache.myfaces.tobago.component.UIReload;
-import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
@@ -60,14 +59,12 @@ public class PanelRenderer extends Panel
       writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
     }
 
-    // TODO check ajax id?
-    if (!FacesContextUtils.isAjax(facesContext)) {
-      final UIComponent facetReload = ComponentUtils.getFacet(panel, Facets.reload);
-      if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {
-        final UIReload update = (UIReload) facetReload;
-        writer.writeAttribute(DataAttributes.RELOAD, Integer.toString(update.getFrequency()), false);
-      }
+    final UIComponent reloadFacet = ComponentUtils.getFacet(panel, Facets.reload);
+    if (reloadFacet instanceof UIReload && reloadFacet.isRendered()) {
+      final UIReload update = (UIReload) reloadFacet;
+      writer.writeAttribute(DataAttributes.RELOAD, Integer.toString(update.getFrequency()), false);
     }
+
     HtmlRendererUtils.renderCommandFacet(panel, facesContext, writer);
     HtmlRendererUtils.encodeContextMenu(facesContext, writer, panel);