blob: 41f97e9bc9862707836091842b5d46c9f259ad77 [file] [log] [blame]
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
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.
-->
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:f="http://java.sun.com/jsf/core" xmlns:tr="http://myfaces.apache.org/trinidad">
<jsp:directive.page contentType="text/html;charset=utf-8"/>
<f:view>
<tr:document title="Dynamic Table Demo">
<tr:form>
<tr:messages/>
<tr:panelGroupLayout layout="vertical">
<f:facet name="separator">
<tr:separator/>
</f:facet>
<tr:panelGroupLayout layout="horizontal">
<tr:commandLink immediate="true" text="Component Guide" action="guide"/>
<tr:spacer width="10"/>
<tr:goLink destination="http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_table.html"
text="Tag Documentation"/>
<tr:spacer width="10"/>
<tr:goLink destination="http://myfaces.apache.org/trinidad/skin-selectors.html#table"
text="Skinning Key Documentation"/>
</tr:panelGroupLayout>
<tr:outputFormatted styleUsage="instruction" value="&lt;b>Dynamic table&lt;/b>"/>
<f:verbatim>&lt;ul&gt; &lt;li&gt; The table should tolerate RowCounts which are greater
than the actual RowCount. &lt;li&gt; The table should try to preserve the page
being viewed, when the rowCounts change. &lt;li&gt; In the following example,
the table should not render NULL values nor throw Exceptions: &lt;/ul&gt;</f:verbatim>
<tr:panelFormLayout>
<tr:inputText label="RowCount" value="#{dynamicTable.rowCount}" accessKey="R">
<f:facet name="help">
<tr:outputText value="Minimum -1. Maximum 400"/>
</f:facet>
<f:validateLongRange minimum="-1" maximum="400"/>
</tr:inputText>
<tr:inputText label="RowCount (Actual)" accessKey="A"
value="#{dynamicTable.actualRowCount}">
<f:facet name="help">
<tr:outputText value="Minimum 0. Maximum 400"/>
</f:facet>
<f:validateLongRange minimum="0" maximum="400"/>
</tr:inputText>
<tr:inputText label="Block Size" accessKey="B" value="#{dynamicTable.blockSize}">
<f:facet name="help">
<tr:outputText value="Minimum 0"/>
</f:facet>
<f:validateLongRange minimum="0"/>
</tr:inputText>
<tr:inputText label="Height" value="#{dynamicTable.height}" accessKey="H" />
<f:facet name="footer">
<tr:commandButton textAndAccessKey="&amp;Update"/>
</f:facet>
</tr:panelFormLayout>
<tr:table var="row" emptyText="No Data" value="#{table}" height="#{dynamicTable.height}"
rows="#{dynamicTable.blockSize}" summary="Dynamic Table" width="100%">
<tr:column sortable="true" sortProperty="int">
<f:facet name="header">
<tr:outputText value="Number"/>
</f:facet>
<tr:outputText value="#{row.int}"/>
</tr:column>
<tr:column headerText="Column group" sortable="true" sortProperty="string">
<tr:column>
<f:facet name="header">
<tr:outputText value="Text"/>
</f:facet>
<tr:outputText value="#{row.string}"/>
</tr:column>
<tr:column>
<tr:outputText value="#{row.boolean}"/>
</tr:column>
</tr:column>
</tr:table>
<tr:table var="row" emptyText="No Data" value="#{null}" height="#{dynamicTable.height}"
rows="#{dynamicTable.blockSize}" summary="Dynamic Table" width="90%">
<tr:column sortable="true" sortProperty="int">
<f:facet name="header">
<tr:outputText value="Number"/>
</f:facet>
<tr:outputText value="#{row.int}"/>
</tr:column>
<tr:column sortable="true" sortProperty="string">
<f:facet name="header">
<tr:outputText value="Text"/>
</f:facet>
<tr:outputText value="#{row.string}"/>
</tr:column>
<tr:column>
<tr:outputText value="#{row.boolean}"/>
</tr:column>
</tr:table>
</tr:panelGroupLayout>
</tr:form>
</tr:document>
</f:view>
</jsp:root>