You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/02/03 12:01:42 UTC

svn commit: r740271 - in /myfaces/tobago/branches/tobago-1.0.x: sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/

Author: weber
Date: Tue Feb  3 11:01:41 2009
New Revision: 740271

URL: http://svn.apache.org/viewvc?rev=740271&view=rev
Log:
(TOBAGO-740) Alternative SheetRenderer

Modified:
    myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Modified: myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java?rev=740271&r1=740270&r2=740271&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java Tue Feb  3 11:01:41 2009
@@ -19,6 +19,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.StringUtils;
+
 import org.apache.myfaces.tobago.TobagoConstants;
 import org.apache.myfaces.tobago.util.StringUtil;
 import org.apache.myfaces.tobago.config.TobagoConfig;
@@ -210,9 +212,15 @@
       odd = !odd;
       final String rowClass = odd ? "tobago-sheet-content-odd " : "tobago-sheet-content-even ";
 
+      //TODO make markup toago compatible
+      String[] rowMarkups = (String[]) data.getAttributes().get("rowMarkup");
+      String rowMarkup = "";
+      if (rowMarkup != null) {
+        rowMarkup = " " + StringUtils.join(rowMarkups, " ");
+      }
 
       writer.startElement(HtmlConstants.DIV, null);
-      writer.writeClassAttribute("tobago-simpleSheet-row " + rowClass);
+      writer.writeClassAttribute("tobago-simpleSheet-row " + rowClass + rowMarkup);
       writer.writeIdAttribute(sheetId + "_data_tr_" + row);
       writer.writeAttribute(HtmlAttributes.STYLE, "top: "+ top+ "px; left: 0px;", false);
       writer.flush();
@@ -225,6 +233,7 @@
         List<UIComponent> childs = data.getRenderedChildrenOf(column);
         writer.startElement(HtmlConstants.DIV, null);
         writer.writeClassAttribute("tobago-simpleSheet-cell");
+        // todo cell markup
            // + (rowSelected ? " tobabo-simpleSheet-cell-selected" : ""));
         writer.writeIdAttribute(sheetId + "_" + row + "_" + columnIndex);
         final String align = (String) column.getAttributes().get(TobagoConstants.ATTR_ALIGN);

Modified: myfaces/tobago/branches/tobago-1.0.x/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.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=740271&r1=740270&r2=740271&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Tue Feb  3 11:01:41 2009
@@ -313,7 +313,7 @@
       if (keyCode == 13) {
         if (input.value != input.nextSibling.innerHTML) {
           this.reloadWithAction2(event.srcElement, input.actionId, null);
-          Tobago.stopEventPropagation(event);          
+          Tobago.stopEventPropagation(event);
         }
         else {
           this.textInput = input;
@@ -405,27 +405,7 @@
 
 Tobago.Sheet.prototype.setScrollPosition = function(divElement) {
 
-  var hidden;
-
-//  var s1 = new Date().getTime();
-
-//  for (var i = 0; i < 1000; i++) {
-    hidden = divElement.firstChild;
-    while (hidden && hidden.id != this.scrollPositionId) {
-      hidden = hidden.nextSibling;
-    }
-//  }
-
-//  var s2 = new Date().getTime();
-
-//  for (var i = 0; i < 1000; i++) {
-//    hidden = Tobago.element(this.scrollPositionId);
-//  }
-
-//  var s3 = new Date().getTime();
-
-//  LOG.info(" zeit 1 = " + (s2 - s1));
-//  LOG.info(" zeit 2 = " + (s3 - s2));
+  var hidden = divElement.childNodes[1];
 
   if (hidden) {
     var sep = hidden.value.indexOf(";");