myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1498844 - in /myfaces/tobago/branches/tobago-1.5.x: tobago-example/tobago-example-test/src/main/webapp/tc/sheet/ tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/
Date Tue, 02 Jul 2013 08:55:12 GMT
Author: lofwyr
Date: Tue Jul  2 08:55:12 2013
New Revision: 1498844

URL: http://svn.apache.org/r1498844
Log:
TOBAGO-1284: tc:sheet: a disabled columnSelector allows selecting a row by clicking on background
of the row

Modified:
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.selenium.html
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.xhtml
    myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.selenium.html
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.selenium.html?rev=1498844&r1=1498843&r2=1498844&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.selenium.html
(original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.selenium.html
Tue Jul  2 08:55:12 2013
@@ -52,26 +52,16 @@
 <tr>
 	<td>verifyValue</td>
 	<td>id=page:sheet_data_row_selector_1</td>
-	<td>on</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_2</td>
-	<td>on</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_3</td>
-	<td>on</td>
+	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_4</td>
-	<td>on</td>
+	<td>id=page:sheet_data_row_selector_9</td>
+	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_5</td>
+	<td>id=page:sheet_data_row_selector_10</td>
 	<td>on</td>
 </tr>
 <tr>
@@ -87,21 +77,16 @@
 <tr>
 	<td>assertAttribute</td>
 	<td>//table/tbody/tr[2]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-even tobago-sheet-row-markup-selected</td>
-</tr>
-<tr>
-	<td>assertAttribute</td>
-	<td>//table/tbody/tr[3]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-odd tobago-sheet-row-markup-selected</td>
+	<td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[4]@class</td>
-    <td>tobago-sheet-row tobago-sheet-row-markup-even tobago-sheet-row-markup-selected</td>
+	<td>//table/tbody/tr[10]@class</td>
+	<td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[5]@class</td>
+	<td>//table/tbody/tr[11]@class</td>
 	<td>tobago-sheet-row tobago-sheet-row-markup-odd tobago-sheet-row-markup-selected</td>
 </tr>
 <tr>
@@ -131,22 +116,12 @@
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_2</td>
+	<td>id=page:sheet_data_row_selector_9</td>
 	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_3</td>
-	<td>off</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_4</td>
-	<td>off</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_5</td>
+	<td>id=page:sheet_data_row_selector_10</td>
 	<td>off</td>
 </tr>
 <tr>
@@ -166,17 +141,12 @@
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[3]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-odd</td>
-</tr>
-<tr>
-	<td>assertAttribute</td>
-	<td>//table/tbody/tr[4]@class</td>
-    <td>tobago-sheet-row tobago-sheet-row-markup-even</td>
+	<td>//table/tbody/tr[10]@class</td>
+	<td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[5]@class</td>
+	<td>//table/tbody/tr[11]@class</td>
 	<td>tobago-sheet-row tobago-sheet-row-markup-odd</td>
 </tr>
 <tr>
@@ -191,12 +161,12 @@
 </tr>
 <tr>
 	<td>click</td>
-	<td>id=page:sheet_data_row_selector_2</td>
+	<td>id=page:sheet_data_row_selector_1</td>
 	<td></td>
 </tr>
 <tr>
 	<td>click</td>
-	<td>id=page:sheet_data_row_selector_4</td>
+	<td>id=page:sheet_data_row_selector_10</td>
 	<td></td>
 </tr>
 <tr>
@@ -211,26 +181,16 @@
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_2</td>
-	<td>on</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_3</td>
+	<td>id=page:sheet_data_row_selector_9</td>
 	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_4</td>
+	<td>id=page:sheet_data_row_selector_10</td>
 	<td>on</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_5</td>
-	<td>off</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
 	<td>id=page:sheet_data_row_selector_19</td>
 	<td>off</td>
 </tr>
@@ -246,17 +206,12 @@
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[3]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-odd tobago-sheet-row-markup-selected</td>
-</tr>
-<tr>
-	<td>assertAttribute</td>
-	<td>//table/tbody/tr[4]@class</td>
-    <td>tobago-sheet-row tobago-sheet-row-markup-even</td>
+	<td>//table/tbody/tr[10]@class</td>
+	<td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[5]@class</td>
+	<td>//table/tbody/tr[11]@class</td>
 	<td>tobago-sheet-row tobago-sheet-row-markup-odd tobago-sheet-row-markup-selected</td>
 </tr>
 <tr>
@@ -282,27 +237,17 @@
 <tr>
 	<td>verifyValue</td>
 	<td>id=page:sheet_data_row_selector_1</td>
-	<td>on</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_2</td>
 	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_3</td>
-	<td>on</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_4</td>
+	<td>id=page:sheet_data_row_selector_9</td>
 	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_5</td>
-	<td>on</td>
+	<td>id=page:sheet_data_row_selector_10</td>
+	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
@@ -317,21 +262,16 @@
 <tr>
 	<td>assertAttribute</td>
 	<td>//table/tbody/tr[2]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-even tobago-sheet-row-markup-selected</td>
-</tr>
-<tr>
-	<td>assertAttribute</td>
-	<td>//table/tbody/tr[3]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-odd</td>
+	<td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[4]@class</td>
-    <td>tobago-sheet-row tobago-sheet-row-markup-even tobago-sheet-row-markup-selected</td>
+	<td>//table/tbody/tr[10]@class</td>
+    <td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[5]@class</td>
+	<td>//table/tbody/tr[11]@class</td>
 	<td>tobago-sheet-row tobago-sheet-row-markup-odd</td>
 </tr>
 <tr>
@@ -367,27 +307,17 @@
 <tr>
 	<td>verifyValue</td>
 	<td>id=page:sheet_data_row_selector_1</td>
-	<td>on</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_2</td>
 	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_3</td>
-	<td>on</td>
-</tr>
-<tr>
-	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_4</td>
+	<td>id=page:sheet_data_row_selector_9</td>
 	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
-	<td>id=page:sheet_data_row_selector_5</td>
-	<td>on</td>
+	<td>id=page:sheet_data_row_selector_10</td>
+	<td>off</td>
 </tr>
 <tr>
 	<td>verifyValue</td>
@@ -402,21 +332,16 @@
 <tr>
 	<td>assertAttribute</td>
 	<td>//table/tbody/tr[2]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-even tobago-sheet-row-markup-selected</td>
-</tr>
-<tr>
-	<td>assertAttribute</td>
-	<td>//table/tbody/tr[3]@class</td>
-	<td>tobago-sheet-row tobago-sheet-row-markup-odd</td>
+	<td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[4]@class</td>
-    <td>tobago-sheet-row tobago-sheet-row-markup-even tobago-sheet-row-markup-selected</td>
+	<td>//table/tbody/tr[10]@class</td>
+    <td>tobago-sheet-row tobago-sheet-row-markup-even</td>
 </tr>
 <tr>
 	<td>assertAttribute</td>
-	<td>//table/tbody/tr[5]@class</td>
+	<td>//table/tbody/tr[11]@class</td>
 	<td>tobago-sheet-row tobago-sheet-row-markup-odd</td>
 </tr>
 <tr>

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.xhtml?rev=1498844&r1=1498843&r2=1498844&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.xhtml
(original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-selector.xhtml
Tue Jul  2 08:55:12 2013
@@ -24,12 +24,49 @@
 
   <tc:page id="page">
     <f:facet name="layout">
-      <tc:gridLayout rows="auto" columns="600px"/>
+      <tc:gridLayout rows="160px;auto" columns="600px"/>
     </f:facet>
 
+    <tc:panel>
+      <f:facet name="layout">
+        <tc:flowLayout />
+      </f:facet>
+
+      <ul>
+        <li>
+          <tc:out value="Selection in a sheet."/>
+        </li>
+        <li>
+          <tc:out value="Planets aren't selectable."/>
+        </li>
+      </ul>
+
+      <ol>
+        <li>
+          <tc:out value="Select all"/>
+        </li>
+        <li>
+          <tc:out value="Unselect all"/>
+        </li>
+        <li>
+          <tc:out value="Select 1st, 2nd (disabled) and 11th row"/>
+        </li>
+        <li>
+          <tc:out value="Toggle all"/>
+        </li>
+        <li>
+          <tc:out value="Go to the 2nd page"/>
+        </li>
+        <li>
+          <tc:out value="Go back to the 1st page"/>
+        </li>
+      </ol>
+
+    </tc:panel>
+
     <tc:sheet value="#{sheet.solarArray}" id="sheet" columns="auto;*;*" var="luminary"
rows="20">
 
-      <tc:columnSelector/>
+      <tc:columnSelector disabled="#{luminary.orbit == 'Sun'}"/>
 
       <tc:column label="Name" id="name" sortable="true">
         <tc:out value="#{luminary.name}"/>

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1498844&r1=1498843&r2=1498844&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
(original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
Tue Jul  2 08:55:12 2013
@@ -528,14 +528,6 @@ Tobago.Sheet.prototype.getSiblingRow = f
   return row.parentNode.childNodes[i];
 };
 
-Tobago.Sheet.prototype.isEnabled = function(checkbox) {
-  return checkbox == null
-      || checkbox.attributes == null
-      || checkbox.attributes.disabled === undefined
-      || checkbox.attributes.disabled == null
-      || checkbox.attributes.disabled.value != "true";
-};
-
 Tobago.Sheet.prototype.getRows = function() {
   // todo: use a util for "id replace"
   // find all rows in current sheet
@@ -554,7 +546,7 @@ Tobago.Sheet.prototype.resetSelected = f
 
 Tobago.Sheet.prototype.toggleSelection = function(rowIndex, row, checkbox) {
   this.lastClickedRowIndex = rowIndex;
-  if (this.isEnabled(checkbox)) {
+  if (!jQuery(checkbox).prop("disabled")) {
     var selected = Tobago.element(this.selectedId);
     if (selected.value.indexOf("," + rowIndex + ",") < 0) {
       this.selectRow(selected, rowIndex, row, checkbox);
@@ -585,7 +577,7 @@ Tobago.Sheet.prototype.selectRange = fun
   for (var rowIndex = indexA; rowIndex < indexB; rowIndex++) {
     var row = rows.get(rowIndex - this.firstRowIndex);
     var checkbox = this.getSelectorCheckbox(row);
-    if (this.isEnabled(checkbox)) {
+    if (!jQuery(checkbox).prop("disabled")) {
       if (selectDeselected && selected.value.indexOf("," + rowIndex + ",") < 0)
{
         this.selectRow(selected, rowIndex, row, checkbox);
       } else if (deselectSelected && selected.value.indexOf("," + rowIndex + ",")
>= 0) {



Mime
View raw message