Author: lfryc(a)redhat.com
Date: 2010-12-02 09:29:38 -0500 (Thu, 02 Dec 2010)
New Revision: 20307
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml
Log:
added sample of rich:extendedDataTable selection (RFPL-918)
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml 2010-12-02
14:29:04 UTC (rev 20306)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml 2010-12-02
14:29:38 UTC (rev 20307)
@@ -64,6 +64,10 @@
<metamer:testPageLink id="filtering"
outcome="filtering" value="Table Filtering">
Page that contains filterable <b>rich:extendedDataTable</b>
(with model containing capitals) and input boxes for all its attributes.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="selection"
outcome="selection" value="Selection">
+ Page that contains sample of <b>rich:extendedDataTable</b>
selection model
+ </metamer:testPageLink>
</ui:define>
</ui:composition>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/selection.xhtml 2010-12-02
14:29:38 UTC (rev 20307)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <style type="text/css">
+ .rf-edt {
+ width: 300px !important;
+ height: 300px !important;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox"
value="#{richExtendedDataTableBean.state}">
+ <a4j:ajax render="richEDT scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ <rich:dataScroller id="scroller1" for="richEDT"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="richEDT"/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:extendedDataTable id="richEDT"
+
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
+
first="#{richExtendedDataTableBean.attributes['first'].value}"
+
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
+
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
+
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
+
rows="#{richExtendedDataTableBean.attributes['rows'].value}"
+
selection="#{richExtendedDataTableBean.attributes['selection'].value}"
+
selectionchange="#{richExtendedDataTableBean.attributes['selectionchange'].value}"
+
sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
+
sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
+
style="#{richExtendedDataTableBean.attributes['style'].value}"
+
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
+ value="#{richExtendedDataTableBean.state ?
model.capitals : null}"
+ var="record"
+ >
+ <a4j:ajax execute="@this" event="selectionchange"
render="selectionOutput" />
+
+ <f:facet name="noData">
+ <h:outputText value="There is no data."
style="color: red;"/>
+ </f:facet>
+
+ <f:facet name="caption">
+ <h:outputText id="captionFacet" value="Caption
Facet" />
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText value="Header Facet" />
+ </f:facet>
+
+ <rich:column id="columnState"
sortBy="#{record.state}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState"
value="State" />
+ </f:facet>
+
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="State" />
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="columnCapital"
sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital"
value="Capital" />
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital"
value="Capital" />
+ </f:facet>
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
for="richEDT" page="#{richExtendedDataTableBean.page}"
maxPages="7" render="richEDT" />
+ </f:facet>
+
+ </rich:extendedDataTable>
+
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Selection:" />
+ <h:outputText id="selectionOutput"
value="#{richExtendedDataTableBean.attributes['selection'].value}"
/>
+ </h:panelGrid>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <fieldset>
+ <legend>scroller1</legend>
+
+ <h:commandButton id="buttonFirst1" value="<<
first">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}"
operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <h:commandButton id="buttonPrev1" value="<
previous">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}" operation="previous"
/>
+ </h:commandButton>
+
+ <h:commandButton id="buttonNext1" value="next
>">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}" operation="next" />
+ </h:commandButton>
+
+ <h:commandButton id="buttonLast1" value="last
>>">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller1')}"
operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
+ </fieldset>
+
+ <fieldset>
+ <legend>scroller2</legend>
+ <h:commandButton id="buttonFirst2" value="<<
first">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}"
operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <h:commandButton id="buttonPrev2" value="<
previous">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}" operation="previous"
/>
+ </h:commandButton>
+
+ <h:commandButton id="buttonNext2" value="next
>">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}" operation="next" />
+ </h:commandButton>
+
+ <h:commandButton id="buttonLast2" value="last
>>">
+ <rich:componentControl event="click"
target="#{rich:clientId('scroller2')}"
operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
+ </fieldset>
+
+ <metamer:attributes
value="#{richExtendedDataTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file