myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1790262 - in /myfaces/tobago/branches/tobago-3.0.x: ./ tobago-core/src/main/java/org/apache/myfaces/tobago/context/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ tobago-core/src/main/java/org/apache/myfac...
Date Wed, 05 Apr 2017 13:52:49 GMT
Author: lofwyr
Date: Wed Apr  5 13:52:48 2017
New Revision: 1790262

URL: http://svn.apache.org/viewvc?rev=1790262&view=rev
Log:
Merge from trunk
TOBAGO-1728: Selector for all/none/toggle in sheet is displayed behind the sheet-body
* Re-implementation with a single checkbox instead of using dropdown menu.
* It's easier to implement and easier to use.

Modified:
    myfaces/tobago/branches/tobago-3.0.x/   (props changed)
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
  (contents, props changed)
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource.xml
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_de.xml
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_es.xml
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-sheet.js

Propchange: myfaces/tobago/branches/tobago-3.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr  5 13:52:48 2017
@@ -1,3 +1,3 @@
 /myfaces/tobago/branches/tobago-1.5.x:1356585,1357124
 /myfaces/tobago/branches/tobago-tree-table:1226794-1341423
-/myfaces/tobago/trunk:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1591854,1600239,1600818,1601860,1602151,1602154,1602343,1604224,1606201,1607642,1609696-1609697,1609718,1610942,1610948,1610970,1610989,1611011,1611259,1611264,1611276,1611329,1611338-1611339,1611571,1613015,1613032,1614827,1614853,1615053,1615114,1615121,1617310,1619789,1621101,1621107,1621134,1621156,1621264,1621282,1621332,1622222,1622243,1622508,1623934,1624033,1625968,1625972,1626270,1628899,1628953,1636842,1636911,1640117,1640147,1640541,1640548,1640638,1640761,1640917,1641575,1641635,1641772,1641775,1641777,1656502,1656507,1657180,1657269,1657276,1657279,1658343,1658909,1658912,1659026,1659031,1660696,1660699,1660708,1660714,1665486,1665521,1665549,1665569-1665570,1666464,1667304,1667306-1667307,1667309,1668147,1668153,1668249,1675330,1675565,1675584,1675588-1675589,1675636,1676030,1676035,1676038,1679031,1680197,1681981,1682187,1682448,1682545,1682548,1683231,1683306,1683373,1683664
 ,1686204,1687354,1693426,1696720,1698292,1698297,1700742,1700795,1701249,1701251,1701256,1701980,1709006,1725894,1726691,1726986,1727161,1731050-1731051,1731054,1731057,1731218-1731219,1780251,1780345,1780393,1780418,1780421,1780519,1781211,1781244,1781273,1788196,1788214-1788215,1788239,1788381,1788484
+/myfaces/tobago/trunk:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1591854,1600239,1600818,1601860,1602151,1602154,1602343,1604224,1606201,1607642,1609696-1609697,1609718,1610942,1610948,1610970,1610989,1611011,1611259,1611264,1611276,1611329,1611338-1611339,1611571,1613015,1613032,1614827,1614853,1615053,1615114,1615121,1617310,1619789,1621101,1621107,1621134,1621156,1621264,1621282,1621332,1622222,1622243,1622508,1623934,1624033,1625968,1625972,1626270,1628899,1628953,1636842,1636911,1640117,1640147,1640541,1640548,1640638,1640761,1640917,1641575,1641635,1641772,1641775,1641777,1656502,1656507,1657180,1657269,1657276,1657279,1658343,1658909,1658912,1659026,1659031,1660696,1660699,1660708,1660714,1665486,1665521,1665549,1665569-1665570,1666464,1667304,1667306-1667307,1667309,1668147,1668153,1668249,1675330,1675565,1675584,1675588-1675589,1675636,1676030,1676035,1676038,1679031,1680197,1681981,1682187,1682448,1682545,1682548,1683231,1683306,1683373,1683664
 ,1686204,1687354,1693426,1696720,1698292,1698297,1700742,1700795,1701249,1701251,1701256,1701980,1709006,1725894,1726691,1726986,1727161,1731050-1731051,1731054,1731057,1731218-1731219,1780251,1780345,1780393,1780418,1780421,1780519,1781211,1781244,1781273,1788196,1788214-1788215,1788239,1788381,1788484,1790232

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
Wed Apr  5 13:52:48 2017
@@ -95,8 +95,14 @@ public final class Markup implements Ser
   public static final Markup RIGHT = valueOf("right");
   public static final Markup SECONDS = valueOf("seconds");
   public static final Markup SELECTED = valueOf("selected");
+  /** @deprecated since 3.0.4 */
+  @Deprecated
   public static final Markup SHEET_SELECT_ALL = valueOf("sheetSelectAll");
+  /** @deprecated since 3.0.4 */
+  @Deprecated
   public static final Markup SHEET_DESELECT_ALL = valueOf("sheetDeselectAll");
+  /** @deprecated since 3.0.4 */
+  @Deprecated
   public static final Markup SHEET_TOGGLE_ALL = valueOf("sheetToggleAll");
   public static final Markup SMALL = valueOf("small");
   public static final Markup SORTABLE = valueOf("sortable");

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
Wed Apr  5 13:52:48 2017
@@ -62,10 +62,8 @@ import org.apache.myfaces.tobago.renderk
 import org.apache.myfaces.tobago.renderkit.css.Icons;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.css.TobagoClass;
-import org.apache.myfaces.tobago.renderkit.html.Arias;
 import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
-import org.apache.myfaces.tobago.renderkit.html.HtmlButtonTypes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
 import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -97,7 +95,6 @@ public class SheetRenderer extends Rende
   private static final String SUFFIX_COLUMN_RENDERED = ComponentUtils.SUB_SEPARATOR + "rendered";
   private static final String SUFFIX_SCROLL_POSITION = ComponentUtils.SUB_SEPARATOR + "scrollPosition";
   private static final String SUFFIX_SELECTED = ComponentUtils.SUB_SEPARATOR + "selected";
-  private static final String SUFFIX_SELECTOR_DROPDOWN = ComponentUtils.SUB_SEPARATOR + "selectorDropdown";
 
   @Override
   public void decode(final FacesContext facesContext, final UIComponent component) {
@@ -445,7 +442,7 @@ public class SheetRenderer extends Rende
               writer.writeAttribute(HtmlAttributes.DISABLED, selector.isDisabled());
               writer.writeClassAttribute(
                   BootstrapClass.FORM_CHECK_INLINE,
-                  Classes.create(sheet, "columnSelector"));
+                  TobagoClass.SHEET__COLUMN_SELECTOR);
               writer.endElement(HtmlElements.INPUT);
             } else if (normalColumn instanceof AbstractUIColumnNode) {
               RenderUtils.encode(facesContext, normalColumn);
@@ -849,44 +846,15 @@ public class SheetRenderer extends Rende
             writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
 
             if (column instanceof UIColumnSelector && selectable.isMulti()) {
-              writer.writeClassAttribute(Classes.create(sheet, "selectorDropdown"));
+              writer.startElement(HtmlElements.INPUT);
+              writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.CHECKBOX);
 
-              writer.startElement(HtmlElements.DIV);
-              writer.writeClassAttribute(BootstrapClass.DROPDOWN);
-              writer.startElement(HtmlElements.BUTTON);
-              writer.writeClassAttribute(
-                  BootstrapClass.BTN, BootstrapClass.BTN_SECONDARY, BootstrapClass.DROPDOWN_TOGGLE);
-              writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
-              writer.writeIdAttribute(sheet.getClientId(facesContext) + SUFFIX_SELECTOR_DROPDOWN);
-              writer.writeAttribute(DataAttributes.TOGGLE, "dropdown", false);
-              writer.writeAttribute(Arias.HASPOPUP, Boolean.TRUE.toString(), false);
-              writer.writeAttribute(Arias.EXPANDED, Boolean.FALSE.toString(), false);
-              writer.endElement(HtmlElements.BUTTON);
-              writer.startElement(HtmlElements.DIV);
-              writer.writeClassAttribute(BootstrapClass.DROPDOWN_MENU);
-              writer
-                  .writeAttribute(Arias.LABELLEDBY, sheet.getClientId(facesContext) + SUFFIX_SELECTOR_DROPDOWN,
false);
-              writer.startElement(HtmlElements.BUTTON);
-              writer.writeClassAttribute(BootstrapClass.DROPDOWN_ITEM);
-              writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
-              writer.writeAttribute(DataAttributes.COMMAND, "sheetSelectAll", false);
-              writer.writeText(TobagoResourceBundle.getString(facesContext, "sheetMenuSelect"));
-              writer.endElement(HtmlElements.BUTTON);
-              writer.startElement(HtmlElements.BUTTON);
-              writer.writeClassAttribute(BootstrapClass.DROPDOWN_ITEM);
-              writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
-              writer.writeAttribute(DataAttributes.COMMAND, "sheetDeselectAll", false);
-              writer.writeText(TobagoResourceBundle.getString(facesContext, "sheetMenuUnselect"));
-              writer.endElement(HtmlElements.BUTTON);
-              writer.startElement(HtmlElements.BUTTON);
-              writer.writeClassAttribute(BootstrapClass.DROPDOWN_ITEM);
-              writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
-              writer.writeAttribute(DataAttributes.COMMAND, "sheetToggleAll", false);
-              writer
-                  .writeText(TobagoResourceBundle.getString(facesContext, "sheetMenuToggleselect"));
-              writer.endElement(HtmlElements.BUTTON);
-              writer.endElement(HtmlElements.DIV);
-              writer.endElement(HtmlElements.DIV);
+              writer.writeClassAttribute(TobagoClass.SHEET__COLUMN_SELECTOR);
+              writer.writeAttribute(
+                  HtmlAttributes.TITLE,
+                  TobagoResourceBundle.getString(facesContext, "sheetMenuSelect"),
+                  true);
+              writer.endElement(HtmlElements.INPUT);
             } else {
               RenderUtils.encode(facesContext, cellComponent);
             }

Propchange: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr  5 13:52:48 2017
@@ -1,3 +1,4 @@
 /myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java:1356585,1357124
 /myfaces/tobago/branches/tobago-tree-table/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java:1226794-1341423
+/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java:1790232
 /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java:1571193,1571804,1571816,1571941,1571945,1571962,1571966,1576730,1589960,1591854,1600239,1600818,1601860,1602151,1602154,1602343,1604224,1606201,1607642,1609696-1609697,1609718,1610942,1610948,1610970,1610989,1611011,1611259,1611264,1611276,1611329,1611338-1611339,1611571,1613015,1613032,1614827,1614853,1615053,1615114,1615121,1617310,1619789,1621101,1621107,1621134,1621156,1621264,1621282,1621332,1622222,1622243,1622508,1623934,1624033,1625968,1625972,1626270,1628899,1628953,1636842,1636911,1642608,1657269,1682545

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
Wed Apr  5 13:52:48 2017
@@ -80,6 +80,7 @@ public enum TobagoClass implements CssIt
   SELECT_ONE_RADIO__INLINE("tobago-selectOneRadio-inline"),
   SHEET__HEADER("tobago-sheet-header"),
   SHEET__BODY_TABLE("tobago-sheet-bodyTable"),
+  SHEET__COLUMN_SELECTOR("tobago-sheet-columnSelector"),
   SHEET__HEADER_TABLE("tobago-sheet-headerTable"),
   SHEET__PAGING_INPUT("tobago-sheet-pagingInput"),
   SHEET__PAGING_OUTPUT("tobago-sheet-pagingOutput"),

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource.xml?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource.xml
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource.xml
Wed Apr  5 13:52:48 2017
@@ -58,8 +58,6 @@
   <entry key="sheetPagingInfoUndefinedSinglePage">Page {0}</entry>
   <entry key="sheetPagingInfoEmptyPage"/>
   <entry key="sheetPagingInfoPagePagingTip">Click here, to change the displayed page</entry>
-  <entry key="sheetMenuToggleselect">Invert selections</entry>
-  <entry key="sheetMenuUnselect">Unselect all</entry>
   <entry key="sheetMenuSelect">Select all</entry>
 
   <!-- Tree -->

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_de.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_de.xml?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_de.xml
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_de.xml
Wed Apr  5 13:52:48 2017
@@ -61,9 +61,7 @@
   <entry key="sheetPagingInfoUndefinedSinglePage">Seite {0}</entry>
   <entry key="sheetPagingInfoEmptyPage"/>
   <entry key="sheetPagingInfoPagePagingTip">Hier klicken, zum Eingeben der anzuzeigenden
Seite.</entry>
-  <entry key="sheetMenuToggleselect">Markierung umkehren</entry>
-  <entry key="sheetMenuUnselect">Markierungen löschen</entry>
-  <entry key="sheetMenuSelect">Alles markieren</entry>
+  <entry key="sheetMenuSelect">Alles auswählen</entry>
 
   <!-- Tree -->
   <entry key="treeNew">Neu</entry>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_es.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_es.xml?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_es.xml
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/resources/org/apache/myfaces/tobago/context/TobagoResource_es.xml
Wed Apr  5 13:52:48 2017
@@ -58,8 +58,6 @@
   <entry key="sheetPagingInfoUndefinedSinglePage">Página {0}</entry>
   <entry key="sheetPagingInfoEmptyPage"/>
   <entry key="sheetPagingInfoPagePagingTip">Click aquí, para cambiar el nombre desplegado.</entry>
-  <entry key="sheetMenuToggleselect">Invertir seleccion</entry>
-  <entry key="sheetMenuUnselect">Deseleccionar todo</entry>
   <entry key="sheetMenuSelect">Seleccionar todo</entry>
 
   <!-- Tree -->

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/SheetController.java
Wed Apr  5 13:52:48 2017
@@ -21,6 +21,8 @@ package org.apache.myfaces.tobago.exampl
 
 import org.apache.myfaces.tobago.context.Markup;
 import org.apache.myfaces.tobago.example.data.SolarObject;
+import org.apache.myfaces.tobago.model.SelectItem;
+import org.apache.myfaces.tobago.model.Selectable;
 import org.apache.myfaces.tobago.model.SheetState;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.slf4j.Logger;
@@ -46,6 +48,22 @@ public class SheetController implements
 
   private static final Logger LOG = LoggerFactory.getLogger(SheetController.class);
 
+  private static final SelectItem[] SHEET_SELECTABLE;
+
+  static {
+    List<Selectable> collect = new ArrayList<Selectable>();
+    for (Selectable selectable : Selectable.values()) {
+      if (selectable.isSupportedBySheet()) {
+        collect.add(selectable);
+      }
+    }
+    SHEET_SELECTABLE = new SelectItem[collect.size()];
+    for (int i = 0; i < collect.size(); i++) {
+      Selectable selectable = collect.get(i);
+      SHEET_SELECTABLE[i] = new SelectItem(selectable, selectable.name());
+    }
+  }
+
   private List<SolarObject> solarList;
   private List<SolarObject> hugeSolarList;
   private SheetState sheetState;
@@ -53,6 +71,7 @@ public class SheetController implements
   private boolean automaticLayout;
   private List<Markup> markup;
   private int columnEventSample;
+  private Selectable selectable = Selectable.multi;
 
   public SheetController() {
     solarList = SolarObject.getList();
@@ -99,18 +118,6 @@ public class SheetController implements
     return selectedSolarObject;
   }
 
-  public int getNumberOfSelections() {
-    return sheetState.getSelectedRows().size();
-  }
-
-  public int getSelectedRowNumber() {
-    if (sheetState.getSelectedRows().size() <= 0) {
-      return -1;
-    } else {
-      return sheetState.getSelectedRows().get(0);
-    }
-  }
-
   public boolean isAutomaticLayout() {
     return automaticLayout;
   }
@@ -159,4 +166,16 @@ public class SheetController implements
     dateTimeConverter.setPattern("yyyy");
     return dateTimeConverter;
   }
+
+  public Selectable getSelectable() {
+    return selectable;
+  }
+
+  public void setSelectable(Selectable selectable) {
+    this.selectable = selectable;
+  }
+
+  public SelectItem[] getSelectableModes() {
+   return SHEET_SELECTABLE;
+  }
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/20-selector/sheet-column-selector.xhtml
Wed Apr  5 13:52:48 2017
@@ -20,7 +20,8 @@
 <ui:composition template="/main.xhtml"
                 xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
-                xmlns:ui="http://java.sun.com/jsf/facelets">
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core">
   <ui:param name="title" value="#{demoBundle.sheet_column_selector} &lt;tc:columnSelector>"/>
   <p>To insert a selectable column, use the <code class="language-markup">&lt;tc:columnSelector/></code>
tag.
     With the <code>selectable</code> in the <code class="language-markup">&lt;tc:sheet/></code>
tag, you can
@@ -44,7 +45,7 @@
     &lt;/tc:column>
     ...</code></pre>
     <tc:sheet id="s4" value="#{sheetController.solarList}" var="object" rows="2"
-              selectable="singleOrNone" state="#{sheetController.sheetState}">
+              selectable="#{sheetController.selectable}" state="#{sheetController.sheetState}">
       <tc:columnSelector/>
       <tc:column label="Name">
         <tc:in value="#{object.name}" labelLayout="skip"/>
@@ -63,7 +64,12 @@
       </tc:column>
     </tc:sheet>
 
+    <tc:selectOneRadio label="Mode" value="#{sheetController.selectable}" required="true">
+      <tc:selectItems value="#{sheetController.selectableModes}"/>
+      <f:ajax render="s4"/>
+    </tc:selectOneRadio>
+
     <tc:button id="b1" label="Submit"/>
-    <tc:out id="o1" label="Row Number" value="#{sheetController.selectedRowNumber}"/>
+    <tc:out id="o1" label="Row Number" value="#{sheetController.sheetState.selectedRows}"/>
   </tc:section>
 </ui:composition>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-sheet.js?rev=1790262&r1=1790261&r2=1790262&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-sheet.js
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-sheet.js
Wed Apr  5 13:52:48 2017
@@ -71,14 +71,13 @@ Tobago.Sheet.init = function(elements) {
 
   Tobago.Sheet.setup2(sheets);
 
-  Tobago.Utils.selectWithJQuery(elements, "button[data-tobago-command=sheetSelectAll]").click(function(event)
{
-    Tobago.Sheet.selectAll(jQuery(event.target).closest(".tobago-sheet"));
-  });
-  Tobago.Utils.selectWithJQuery(elements, "button[data-tobago-command=sheetDeselectAll]").click(function(event)
{
-    Tobago.Sheet.deselectAll(jQuery(event.target).closest(".tobago-sheet"));
-  });
-  Tobago.Utils.selectWithJQuery(elements, "button[data-tobago-command=sheetToggleAll]").click(function(event)
{
-    Tobago.Sheet.toggleAll(jQuery(event.target).closest(".tobago-sheet"));
+  Tobago.Utils.selectWithJQuery(elements, ".tobago-sheet-header .tobago-sheet-columnSelector").click(function(event)
{
+    var $checkbox = jQuery(event.target);
+    if ($checkbox.is(':checked')) {
+      Tobago.Sheet.selectAll($checkbox.closest(".tobago-sheet"));
+    } else {
+      Tobago.Sheet.deselectAll($checkbox.closest(".tobago-sheet"));
+    }
   });
 
   console.timeEnd("[tobago-sheet] init"); // @DEV_ONLY
@@ -423,7 +422,7 @@ Tobago.Sheet.setup2 = function (sheets)
         }
       });
     }
-    sheet.find("input.tobago-sheet-columnSelector").click(function(event) {event.preventDefault()});
+    sheet.find(".tobago-sheet-cell > input.tobago-sheet-columnSelector").click(function(event)
{event.preventDefault()});
   });
 
     // init reload



Mime
View raw message