myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1793829 - in /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp: content/20-component/080-sheet/40-style/ content/20-component/080-sheet/40-style/sheet-style.xhtml style/demo.css
Date Thu, 04 May 2017 16:13:38 GMT
Author: lofwyr
Date: Thu May  4 16:13:38 2017
New Revision: 1793829

URL: http://svn.apache.org/viewvc?rev=1793829&view=rev
Log:
TOBAGO-1625: <tc:style> support for <tc:row>, <tc:column>
sample

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-style/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-style/sheet-style.xhtml
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css

Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-style/sheet-style.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-style/sheet-style.xhtml?rev=1793829&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-style/sheet-style.xhtml
(added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/080-sheet/40-style/sheet-style.xhtml
Thu May  4 16:13:38 2017
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<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:f="http://java.sun.com/jsf/core">
+  <ui:param name="title" value="Styling inside a sheet"/>
+  <p>
+    Inside of <code>&lt;tc:row></code> and <code>&lt;tc:column></code>
tags a <code>&lt;tc:style></code> can be used
+    to set a CSS class or style to a specific row. In this example the rows are green
+    (via customClass <code>planet</code>) when the object orbit is 'Sun'.
+    The cell in the year column is blue, when the objects discovering year is older than
1900 (custom class is
+    <code>old</code>).
+  </p>
+
+  <tc:sheet value="#{sheetController.solarList}" var="object" rows="20" markup="small"
+            columns="#{sheetController.automaticLayout ? null : '*;*;*;*;*'}">
+    <tc:row>
+      <tc:style customClass="#{object.orbit eq 'Sun' ? 'planet' : ''}"/>
+    </tc:row>
+    <tc:column label="Name">
+      <tc:out value="#{object.name}" labelLayout="skip"/>
+    </tc:column>
+    <tc:column label="Orbit">
+      <tc:out value="#{object.orbit}" labelLayout="skip"/>
+    </tc:column>
+    <tc:column label="Period (Days)">
+      <tc:out value="#{object.period}" labelLayout="skip"/>
+    </tc:column>
+    <tc:column label="Discoverer">
+      <tc:out value="#{object.discoverer}" labelLayout="skip"/>
+    </tc:column>
+    <tc:column label="Year">
+      <tc:style customClass="#{object.discoverYear le 1900 ? 'old' : ''}"/>
+      <tc:out value="#{object.discoverYear}" labelLayout="skip"/>
+    </tc:column>
+  </tc:sheet>
+
+</ui:composition>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css?rev=1793829&r1=1793828&r2=1793829&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/demo.css
Thu May  4 16:13:38 2017
@@ -53,3 +53,11 @@ pre, code {
   text-align: inherit;
   padding: inherit;
 }
+
+.planet {
+  background-color: #5cb85c;
+}
+
+.old {
+  background-color: #b3d4fc;
+}



Mime
View raw message