| <?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"> |
| |
| The sheet control is a simple solution for displaying table based |
| information. The essential features are: |
| <ul> |
| <li>Sorting</li> |
| <li>Paging</li> |
| <li>Tree table</li> |
| <li>Inline editing</li> |
| <li>Column resizing</li> |
| <li>Inline-Editing</li> |
| <li>Styling</li> |
| <li>Header customization</li> |
| </ul> |
| This example shows an application specific sorter, which sorts the sun to the top every time. |
| |
| <p>A <code class="language-markup"><tc:sheet/></code> tag can contain any number of |
| <code class="language-markup"><tc:column/></code> tags. |
| The <code class="language-markup"><tc:column/></code> tag is a container, which may contain |
| output fields, labels, progress bars or even tab groups.</p> |
| <p>Tag Library Documentation: |
| <tc:link label="<tc:sheet/>" image="#{request.contextPath}/image/feather-leaf.png" |
| link="#{apiController.base}/doc/#{apiController.currentRelease}/tld/tc/sheet.html"/> |
| | |
| <tc:link label="<tc:column/>" image="#{request.contextPath}/image/feather-leaf.png" |
| link="#{apiController.base}/doc/#{apiController.currentRelease}/tld/tc/column.html"/></p> |
| |
| <tc:section label="Basics"> |
| <p>Two attributes should be recognized in a sheet. |
| The data of the sheet is set in the <code>value</code> attribute. |
| The variablename of a single entry is set by the <code>var</code> attribute, which can be used in the |
| <code class="language-markup"><tc:column/></code> tags. |
| In this example, also the <code>rows</code> attribute is set. So only four rows are shown at a time.</p> |
| <p>In most cases, you should set <code class="language-markup">labelLayout="skip"</code> for |
| components which have usually a label. |
| Otherwise those components have a negative affect on the proportion of the sheet.<br/> |
| For components with a label the attribute <code class="language-css">margin-bottom</code> is set. |
| The margin is add to the height of a row.</p> |
| <demo-highlight language="markup"><tc:sheet value="\#{sheetController.solarList}" |
| var="solarobject" rows="4"> |
| <tc:column label="Name"> |
| <tc:out value="\#{solarobject.name}" labelLayout="skip"/> |
| ...</demo-highlight> |
| <tc:sheet id="s1" value="#{sheetController.solarList}" var="object" rows="4"> |
| <tc:style maxHeight="500px"/> |
| <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:out value="#{object.discoverYear}" labelLayout="skip"/> |
| </tc:column> |
| </tc:sheet> |
| </tc:section> |
| </ui:composition> |