incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r529488 - in /incubator/adffaces/trunk/trinidad/trinidad-impl/src: main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/ main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/ test/resources/org/apache/myf...
Date Tue, 17 Apr 2007 05:16:07 GMT
Author: awiner
Date: Mon Apr 16 22:16:05 2007
New Revision: 529488

URL: http://svn.apache.org/viewvc?view=rev&rev=529488
Log:
ADFFACES-452: select-all/none links on table don't support autoSubmit

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/DesktopTableRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeUtils.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimal-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIE-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIERtl-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalInacc-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalSaf-golden.xml
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/DesktopTableRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/DesktopTableRenderer.java?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/DesktopTableRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/desktop/DesktopTableRenderer.java
Mon Apr 16 22:16:05 2007
@@ -79,6 +79,7 @@
     _allDetailsEnabledKey = type.findKey("allDetailsEnabled");
     _allDisclosed = new AllDetail(type, true);
     _allUndisclosed = new AllDetail(type, false);
+    _autoSubmitKey = type.findKey("autoSubmit");
   }
 
   public DesktopTableRenderer()
@@ -193,7 +194,7 @@
                            _SELECT_NONE_TEXT_KEY, null, hasAllDetails);
       needsDivider = true;
 
-      TableSelectManyRenderer.renderScripts(context, arc, trc);
+      TableSelectManyRenderer.renderScripts(context, arc, trc, isAutoSubmit(bean));
     }
 
     ResponseWriter writer = context.getResponseWriter();
@@ -1101,6 +1102,19 @@
     return toString(bean.getProperty(_heightKey));
   }
 
+  /**
+   * Tells whether or not the autoSubmit attribute is set on the bean
+   *
+   * @param bean the bean
+   */
+  protected boolean isAutoSubmit(FacesBean bean)
+  {
+    if (_autoSubmitKey == null)
+      return false;
+
+    return Boolean.TRUE.equals(bean.getProperty(_autoSubmitKey));
+  }
+
   protected boolean getAllDetailsEnabled(FacesBean bean)
   {
     Object o = bean.getProperty(_allDetailsEnabledKey);
@@ -1202,6 +1216,7 @@
 
   private static final Object _IE_SCROLL_KEY = new Object();
 
+  private PropertyKey _autoSubmitKey;
   private PropertyKey _summaryKey;
   private PropertyKey _heightKey;
   private PropertyKey _allDetailsEnabledKey;

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TableSelectManyRenderer.java
Mon Apr 16 22:16:05 2007
@@ -183,9 +183,10 @@
   }
 
   public static void renderScripts(
-    FacesContext        context,
-    RenderingContext arc,
-    TableRenderingContext trc) throws IOException
+    FacesContext          context,
+    RenderingContext      arc,
+    TableRenderingContext trc,
+    boolean               autoSubmit) throws IOException
   {
     if (arc.getProperties().put(_JS_RENDERED_KEY, Boolean.TRUE) == null)
     {
@@ -196,7 +197,7 @@
 
       String jsCall =
       TreeUtils.setupJSMultiSelectCollectionComponent(
-        SELECTED_KEY, SELECTED_MODE_KEY, false);
+        SELECTED_KEY, SELECTED_MODE_KEY, autoSubmit);
       writer.writeText(jsCall, null);
       writer.writeText(";", null);
       writer.endElement("script");

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeUtils.java?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeUtils.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/table/TreeUtils.java
Mon Apr 16 22:16:05 2007
@@ -242,7 +242,7 @@
 
   public static String callJSSelectAll(String jsVarName, boolean isSelectAll)
   {
-    return jsVarName+".multiSelect("+(isSelectAll ? "true" : "false")+")";
+    return jsVarName+".multiSelect("+(isSelectAll ? "true" : "false")+");return false;";
   }
 
   public static void decodeGotoEvent(final Map<String, String> parameters,

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimal-golden.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimal-golden.xml?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimal-golden.xml
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimal-golden.xml
Mon Apr 16 22:16:05 2007
@@ -170,14 +170,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -516,14 +516,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -862,14 +862,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIE-golden.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIE-golden.xml?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIE-golden.xml
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIE-golden.xml
Mon Apr 16 22:16:05 2007
@@ -162,14 +162,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -501,14 +501,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -840,14 +840,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIERtl-golden.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIERtl-golden.xml?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIERtl-golden.xml
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalIERtl-golden.xml
Mon Apr 16 22:16:05 2007
@@ -162,14 +162,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -501,14 +501,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -840,14 +840,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalInacc-golden.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalInacc-golden.xml?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalInacc-golden.xml
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalInacc-golden.xml
Mon Apr 16 22:16:05 2007
@@ -158,14 +158,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -474,14 +474,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -790,14 +790,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalSaf-golden.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalSaf-golden.xml?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalSaf-golden.xml
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalSaf-golden.xml
Mon Apr 16 22:16:05 2007
@@ -164,14 +164,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -486,14 +486,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -808,14 +808,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml?view=diff&rev=529488&r1=529487&r2=529488
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml
Mon Apr 16 22:16:05 2007
@@ -171,14 +171,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -519,14 +519,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None
@@ -867,14 +867,14 @@
                     
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(true)"
+                         onclick="_uixt_mainId.multiSelect(true);return false;"
                          href="uri-attr:#"
                         >
                       Select All
                     </a>&#xa0;|&#xa0;
                     <a
                          class="OraNavBarActiveLink"
-                         onclick="_uixt_mainId.multiSelect(false)"
+                         onclick="_uixt_mainId.multiSelect(false);return false;"
                          href="uri-attr:#"
                         >
                       Select None



Mime
View raw message