Filtering <tc:sheet/>

Filtering is not a explicit feature of the sheet. It is done in the controller.

To add filtering components to the header of a sheet, use <f:facet name="header">.

Warning: Paging currently doesn't work with filters!

Tag Library Documentation: <tc:sheet/> | <tc:column/>

Filtering

Add a search string to the inputfield or change the value of the dropdown boxes to filter the sheet. If an inputfield lost focus the filtering will be executed.

Name
Orbit
Distance [1000 km]
Period
Discoverer
Year
Sun - 0 0.0 -
Mercury Sun 57910 87.97 -
Venus Sun 108200 224.7 -
Earth Sun 149600 365.26 -
Mars Sun 227940 686.98 -
Jupiter Sun 778330 4332.71 -
Saturn Sun 1429400 10759.5 -
Uranus Sun 2870990 30685.0 Herschel 1781
Neptune Sun 4504300 60190.0 Adams 1846
Pluto Sun 5913520 90800.0 Tombaugh 1930
Moon Earth 384 27.32 -
Phobos Mars 9 0.32 Hall 1877
Deimos Mars 23 1.26 Hall 1877
Metis Jupiter 128 0.29 Synnott 1979
Adrastea Jupiter 129 0.3 Jewitt 1979
  • Rows 1 to 15 of 88
  • Page 1 of 6
<?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:tc="http://myfaces.apache.org/tobago/component" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns="http://www.w3.org/1999/xhtml"> <ui:param name="title" value="#{demoBundle.sheet_filter} &lt;tc:sheet/>"/> <p>Filtering is not a explicit feature of the sheet. It is done in the controller.</p> <p>To add filtering components to the header of a sheet, use <code class="language-markup">&lt;f:facet name="header"></code>.</p> <p><b>Warning:</b> Paging currently doesn't work with filters!</p> <p>Tag Library Documentation: <tc:link label="&lt;tc:sheet/>" image="#{request.contextPath}/image/feather-leaf.png" link="#{demoBundle.tagDocUrl}/#{apiController.currentRelease}/tld/tc/sheet.html"/> | <tc:link label="&lt;tc:column/>" image="#{request.contextPath}/image/feather-leaf.png" link="#{demoBundle.tagDocUrl}/#{apiController.currentRelease}/tld/tc/column.html"/></p> <tc:section label="#{demoBundle.sheet_filter}"> <p>Add a search string to the inputfield or change the value of the dropdown boxes to filter the sheet. If an inputfield lost focus the filtering will be executed.</p> <tc:sheet id="sheet" value="#{sheetFilterController.filteredSolarList}" var="object" rows="15"> <f:facet name="header"> <tc:form id="headerForm"> <tc:panel> <tc:out value="Name"/> <tc:in value="#{sheetFilterController.name}"> <tc:suggest totalCount="10" query="#{sheetFilterController.nameSuggestionQuery}"> <tc:selectItems value="#{sheetFilterController.suggestionSolarList}" var="name" itemValue="#{name}"/> </tc:suggest> <f:ajax execute=":::sheet" render=":::sheet" listener="#{sheetFilterController.filter}"/> </tc:in> </tc:panel> <tc:panel> <tc:out value="Orbit"/> <tc:in value="#{sheetFilterController.orbit}"> <f:ajax execute=":::sheet" render=":::sheet" listener="#{sheetFilterController.filter}"/> </tc:in> </tc:panel> <tc:panel> <tc:out value="Distance [1000 km]"/> <tc:selectOneChoice value="#{sheetFilterController.distance}" converter="#{sheetFilterController.distanceRangeConverter}"> <tc:selectItems value="#{sheetFilterController.distanceItems}"/> <f:ajax execute=":::sheet" render=":::sheet" listener="#{sheetFilterController.filter}"/> </tc:selectOneChoice> </tc:panel> <tc:panel> <tc:out value="Period"/> <tc:out value=""/> </tc:panel> <tc:panel> <tc:out value="Discoverer"/> <tc:in value="#{sheetFilterController.discoverer}"> <f:ajax execute=":::sheet" render=":::sheet" listener="#{sheetFilterController.filter}"/> </tc:in> </tc:panel> <tc:panel> <tc:out value="Year"/> <tc:flexLayout columns="1fr 1fr"> <tc:selectOneChoice value="#{sheetFilterController.minYear}"> <tc:style width="70px"/> <tc:selectItems value="#{sheetFilterController.minYearItems}"/> <f:ajax execute=":::sheet" render=":::sheet" listener="#{sheetFilterController.filter}"/> </tc:selectOneChoice> <tc:selectOneChoice value="#{sheetFilterController.maxYear}"> <tc:style width="70px"/> <tc:selectItems value="#{sheetFilterController.maxYearItems}"/> <f:ajax execute=":::sheet" render=":::sheet" listener="#{sheetFilterController.filter}"/> </tc:selectOneChoice> </tc:flexLayout> </tc:panel> </tc:form> </f:facet> <tc:column> #{object.name} </tc:column> <tc:column> #{object.orbit} </tc:column> <tc:column> #{object.distance} </tc:column> <tc:column> #{object.period} </tc:column> <tc:column> #{object.discoverer} </tc:column> <tc:column> #{object.discoverYear} </tc:column> </tc:sheet> </tc:section> </ui:composition>