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 2012/01/18 10:25:29 UTC

svn commit: r1232805 - in /myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main: java/org/apache/myfaces/tobago/example/test/SheetController.java webapp/tc/sheet/sheet-simple-auto-height.xhtml

Author: lofwyr
Date: Wed Jan 18 09:25:29 2012
New Revision: 1232805

URL: http://svn.apache.org/viewvc?rev=1232805&view=rev
Log:
sample to compute the height of a sheet

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple-auto-height.xhtml
      - copied, changed from r1228133, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple.xhtml
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java?rev=1232805&r1=1232804&r2=1232805&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java Wed Jan 18 09:25:29 2012
@@ -25,8 +25,16 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class SheetController {
-  
+
   private SolarObject[] solarArray = SolarObject.getArray();
+  private SolarObject[] solarArray3;
+
+  public SheetController() {
+    solarArray3 = new SolarObject[3];
+    for (int i = 0; i < 3; i++) {
+      solarArray3[i] = solarArray[i];
+    }
+  }
 
   // Create a copy for sorting, because the LocaleList.DATA is not modifiable.
   private List<LocaleEntry> localeList = new ArrayList<LocaleEntry>(LocaleList.DATA);
@@ -35,6 +43,10 @@ public class SheetController {
     return solarArray;
   }
 
+  public SolarObject[] getSolarArray3() {
+    return solarArray3;
+  }
+
   public List<LocaleEntry> getLocaleList() {
     return localeList;
   }

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple-auto-height.xhtml (from r1228133, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple-auto-height.xhtml?p2=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple-auto-height.xhtml&p1=myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple.xhtml&r1=1228133&r2=1232805&rev=1232805&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/sheet/sheet-simple-auto-height.xhtml Wed Jan 18 09:25:29 2012
@@ -23,9 +23,26 @@
     xmlns:f="http://java.sun.com/jsf/core">
 
   <tc:page id="page">
-    <tc:gridLayoutConstraint width="600px" height="600px"/>
+    <tc:gridLayoutConstraint width="600px"/>
 
-    <tc:sheet value="#{sheet.solarArray}" id="sheet" columns="*;*" var="luminary" rows="5">
+    <tc:box>
+
+    <f:facet name="layout">
+      <tc:gridLayout rows="auto;auto;auto;auto" rowSpacing="50px" margin="50px"/>
+    </f:facet>
+
+    <tc:sheet value="#{sheet.solarArray3}" id="sheet1" columns="*;*" var="luminary" rows="3"
+        showHeader="false">
+      <tc:column label="Name" id="name" sortable="true">
+        <tc:out value="#{luminary.name}"/>
+      </tc:column>
+      <tc:column label="Orbit Of" id="orbit">
+        <tc:out value="#{luminary.orbit}"/>
+      </tc:column>
+    </tc:sheet>
+
+    <tc:sheet value="#{sheet.solarArray3}" id="sheet2" columns="*;*" var="luminary" rows="3"
+        showHeader="true">
       <tc:column label="Name" id="name" sortable="true">
         <tc:out value="#{luminary.name}"/>
       </tc:column>
@@ -34,6 +51,27 @@
       </tc:column>
     </tc:sheet>
 
+    <tc:sheet value="#{sheet.solarArray3}" id="sheet3" columns="*;*" var="luminary" rows="3"
+        showHeader="false" showPagingAlways="true">
+      <tc:column label="Name" id="name" sortable="true">
+        <tc:out value="#{luminary.name}"/>
+      </tc:column>
+      <tc:column label="Orbit Of" id="orbit">
+        <tc:out value="#{luminary.orbit}"/>
+      </tc:column>
+    </tc:sheet>
+
+    <tc:sheet value="#{sheet.solarArray3}" id="sheet4" columns="*;*" var="luminary" rows="3"
+        showHeader="true" showPagingAlways="true">
+      <tc:column label="Name" id="name" sortable="true">
+        <tc:out value="#{luminary.name}"/>
+      </tc:column>
+      <tc:column label="Orbit Of" id="orbit">
+        <tc:out value="#{luminary.orbit}"/>
+      </tc:column>
+    </tc:sheet>
+
+    </tc:box>
     <tc:script file="script/tobago-assert.js"/>
     <!--todo-->
     <!--<tc:script onload="TobagoAssert.assertLayout('page:todo', 0, 0, 600, 14);"/>-->
@@ -43,8 +81,8 @@
         jQuery("td>span").css("background-color", "white");
         jQuery("td:odd").css("background-color", "#ffbbff");
         jQuery("td:even").css("background-color", "#bbffbb");
+        jQuery(".tobago-sheet-body").css("border-color", "Black");
       });
-
     </tc:script>
 
   </tc:page>