blob: fda20dfa787438faa3b95e5e2c4c52abb46a1734 [file] [log] [blame]
<?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">
<p>To insert a selectable column, use the <code class="language-markup">&lt;tc:columnSelector/></code> tag.
With the <code>selectable</code> in the <code class="language-markup">&lt;tc:sheet/></code> tag, you can
adjust, whether the column should show checkboxes (default) or radio button 'singleOrNone'.</p>
<p>Tag Library Documentation:
<tc:link label="&lt;tc:sheet/>" image="#{request.contextPath}/image/feather-leaf.png"
link="#{apiController.base}/doc/#{apiController.currentRelease}/tld/tc/sheet.html"/>
|
<tc:link label="&lt;tc:columnSelector/>" image="#{request.contextPath}/image/feather-leaf.png"
link="#{apiController.base}/doc/#{apiController.currentRelease}/tld/tc/columnSelector.html"/></p>
<tc:section label="Column Selector">
<p>The first column in this sheet contain radio buttons.
After clicking the submit button, the number of the selected row is displayed in the outputfield.</p>
<pre><code class="language-markup">&lt;tc:sheet value="\#{sheetController.solarList}"
var="solarobject" selectable="singleOrNone" rows="2"
state="\#{sheetController.sheetState}">
&lt;tc:columnSelector/>
&lt;tc:column label="Name">
&lt;tc:out value="\#{solarobject.name}"/>
&lt;/tc:column>
...</code></pre>
<tc:sheet id="s4" value="#{sheetController.solarList}" var="object" rows="5"
selectable="#{sheetController.selectable}" state="#{sheetController.sheetState}">
<tc:columnSelector/>
<tc:column label="Name">
<tc:in 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:selectOneRadio label="Mode" value="#{sheetController.selectable}" required="true">
<tc:selectItems value="#{sheetController.selectableModes}"/>
<f:ajax render="s4"/>
</tc:selectOneRadio>
<tc:button id="b1" label="Submit"/>
<tc:out id="o1" label="Row Number" value="#{sheetController.sheetState.selectedRows}"
tip="updated after submit"/>
</tc:section>
</ui:composition>