Author: lfryc(a)redhat.com
Date: 2010-12-01 13:17:49 -0500 (Wed, 01 Dec 2010)
New Revision: 20279
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
Log:
rich:extendedDataTable - pre-automating component preparation (RFPL-918)
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2010-12-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2010-12-01
18:17:49 UTC (rev 20279)
@@ -23,18 +23,20 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
+
import javax.annotation.PostConstruct;
-
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-import org.richfaces.component.SortOrder;
+import javax.faces.bean.ViewScoped;
import org.ajax4jsf.model.DataComponentState;
+import org.richfaces.component.SortOrder;
import org.richfaces.component.UIExtendedDataTable;
-import org.richfaces.event.SortingEvent;
import org.richfaces.model.Filter;
+import org.richfaces.model.SortMode;
import org.richfaces.tests.metamer.Attributes;
import org.richfaces.tests.metamer.model.Employee;
import org.slf4j.Logger;
@@ -42,12 +44,12 @@
/**
* Managed bean for rich:extendedDataTable.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@ManagedBean(name = "richExtendedDataTableBean")
-@SessionScoped
+@ViewScoped
public class RichExtendedDataTableBean implements Serializable {
private static final long serialVersionUID = 481478880649809L;
@@ -60,14 +62,16 @@
private boolean state = true;
// sorting
- private SortOrder capitalsOrder = SortOrder.unsorted;
- private SortOrder statesOrder = SortOrder.unsorted;
+ private Map<String, ColumnSorting> sorting = new ColumnSortingMap();
// filtering
- private String sexFilter;
- private String nameFilter;
- private String titleFilter;
-
+ private Map<String, Object> filtering = new HashMap<String, Object>();
+
+ // facets
+ private Map<String, String> facets = new HashMap<String, String>();
+
+ private UIExtendedDataTable binding;
+
/**
* Initializes the managed bean.
*/
@@ -82,19 +86,46 @@
attributes.setAttribute("rows", 30);
attributes.setAttribute("styleClass",
"extended-data-table");
attributes.setAttribute("style", null);
-
+
+ // hidden attributes
+ attributes.remove("filterVar");
+ attributes.remove("filteringListeners");
+ attributes.remove("iterationState");
+ attributes.remove("iterationStatusVar");
+ attributes.remove("relativeRowIndex");
+ attributes.remove("rowAvailable");
+ attributes.remove("rowCount");
+ attributes.remove("rowData");
+ attributes.remove("rowIndex");
+ attributes.remove("rowIndex");
+ attributes.remove("rowKey");
+ attributes.remove("rowKeyConverter");
+ attributes.remove("sortingListeners");
+ attributes.remove("clientFirst");
+ attributes.remove("clientRows");
+
// TODO these must be tested in other way
attributes.remove("componentState");
attributes.remove("rowKeyVar");
attributes.remove("stateVar");
attributes.remove("value");
attributes.remove("var");
-
+ attributes.remove("keepSaved");
+
// TODO can be these set as attributes or only as facets?
attributes.remove("caption");
attributes.remove("header");
attributes.remove("footer");
attributes.remove("noData");
+
+ // facets initial values
+ facets.put("noData", "There is no data.");
+ facets.put("caption", "Caption");
+ facets.put("header", "Header");
+ facets.put("columnStateHeader", "State Header");
+ facets.put("columnStateFooter", "State Footer");
+ facets.put("columnCapitalHeader", "Capital Header");
+ facets.put("columnCapitalFooter", "Capital Footer");
}
public Attributes getAttributes() {
@@ -105,9 +136,17 @@
this.attributes = attributes;
}
+ public UIExtendedDataTable getBinding() {
+ return binding;
+ }
+
+ public void setBinding(UIExtendedDataTable binding) {
+ this.binding = binding;
+ }
+
/**
* Getter for page.
- *
+ *
* @return page number that will be used by data scroller
*/
public int getPage() {
@@ -116,7 +155,9 @@
/**
* Setter for page.
- * @param page page number that will be used by data scroller
+ *
+ * @param page
+ * page number that will be used by data scroller
*/
public void setPage(int page) {
this.page = page;
@@ -140,6 +181,7 @@
/**
* Getter for state.
+ *
* @return true if data should be displayed in table
*/
public boolean isState() {
@@ -148,85 +190,96 @@
/**
* Setter for state.
- * @param state true if data should be displayed in table
+ *
+ * @param state
+ * true if data should be displayed in table
*/
public void setState(boolean state) {
this.state = state;
}
- public SortOrder getCapitalsOrder() {
- return capitalsOrder;
- }
+ public Filter<?> getFilterSexImpl() {
+ return new Filter<Employee>() {
- public void setCapitalsOrder(SortOrder capitalsOrder) {
- this.capitalsOrder = capitalsOrder;
+ public boolean accept(Employee e) {
+ String sex = (String) getFiltering().get("sex");
+ if (sex == null || sex.length() == 0 ||
sex.equalsIgnoreCase("all")
+ || sex.equalsIgnoreCase(e.getSex().toString())) {
+ return true;
+ }
+ return false;
+ }
+ };
}
- public SortOrder getStatesOrder() {
- return statesOrder;
+ public Map<String, String> getFacets() {
+ return facets;
}
- public void setStatesOrder(SortOrder statesOrder) {
- this.statesOrder = statesOrder;
+ public Map<String, ColumnSorting> getSorting() {
+ return sorting;
}
- public String getSexFilter() {
- return sexFilter;
+ public Map<String, Object> getFiltering() {
+ return filtering;
}
- public void setSexFilter(String sexFilter) {
- this.sexFilter = sexFilter;
- }
+ public class ColumnSortingMap extends TreeMap<String, ColumnSorting> {
+ private static final long serialVersionUID = 1L;
- public String getNameFilter() {
- return nameFilter;
+ public ColumnSorting get(Object key) {
+ if (key instanceof String && !containsKey(key)) {
+ String columnName = (String) key;
+ put(columnName, new ColumnSorting(columnName));
+ }
+ return super.get(key);
+ }
}
- public void setNameFilter(String nameFilter) {
- this.nameFilter = nameFilter;
- }
+ public class ColumnSorting {
+ private String columnName;
+ private SortOrder order = SortOrder.unsorted;
- public String getTitleFilter() {
- return titleFilter;
- }
+ public ColumnSorting(String key) {
+ this.columnName = key;
+ }
- public void setTitleFilter(String titleFilter) {
- this.titleFilter = titleFilter;
- }
-
- public void sortByCapitals() {
- statesOrder = SortOrder.unsorted;
- if (capitalsOrder.equals(SortOrder.ascending)) {
- setCapitalsOrder(SortOrder.descending);
- } else {
- setCapitalsOrder(SortOrder.ascending);
+ public SortOrder getOrder() {
+ return order;
}
- }
- public void sortByStates() {
- capitalsOrder = SortOrder.unsorted;
- if (statesOrder.equals(SortOrder.ascending)) {
- setStatesOrder(SortOrder.descending);
- } else {
- setStatesOrder(SortOrder.ascending);
+ public void setOrder(SortOrder order) {
+ this.order = order;
}
- }
- public Filter<?> getFilterSexImpl() {
- return new Filter<Employee>() {
+ @SuppressWarnings("unchecked")
+ public void reverseOrder() {
+ SortMode mode = binding.getSortMode();
- public boolean accept(Employee e) {
- String sex = getSexFilter();
- if (sex == null || sex.length() == 0 ||
sex.equalsIgnoreCase("all") || sex.equalsIgnoreCase(e.getSex().toString())) {
- return true;
- }
- return false;
+ Object sortOrderObject =
getAttributes().get("sortPriority").getValue();
+ Collection<String> sortPriority;
+ if (sortOrderObject instanceof Collection) {
+ sortPriority = (Collection<String>) sortOrderObject;
+ } else {
+ throw new IllegalStateException("sortOrder attribute have to be
Collection");
}
- };
- }
- public void sortingListener(SortingEvent event) {
- System.out.println(event.getSortOrder());
+ if (SortMode.single.equals(mode)) {
+ sorting.clear();
+ sorting.put(columnName, this);
+
+ sortPriority.clear();
+ } else {
+ sortPriority.remove(columnName);
+ }
+
+ sortPriority.add(columnName);
+
+ if (SortOrder.ascending.equals(order)) {
+ order = SortOrder.descending;
+ } else {
+ order = SortOrder.ascending;
+ }
+ }
}
-
}
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties 2010-12-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties 2010-12-01
18:17:49 UTC (rev 20279)
@@ -0,0 +1,2 @@
+attr.sortMode.single=single
+attr.sortMode.multi=multi
\ No newline at end of file
Copied:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
(from rev 20278,
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2010-12-01
18:17:49 UTC (rev 20279)
@@ -0,0 +1,147 @@
+<?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: 215px !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/>
+ </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"
+ >
+
+ <f:facet name="noData">
+ <h:outputText
value="#{richExtendedDataTableBean.facets['noData']}" style="color:
red;"/>
+ </f:facet>
+
+ <f:facet name="caption">
+ <h:outputText id="captionFacet"
value="#{richExtendedDataTableBean.facets['caption']}"
+ rendered="#{not empty
richExtendedDataTableBean.facets['caption']}"/>
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText id="header"
value="#{richExtendedDataTableBean.facets['header']}"
+ rendered="#{not empty
richExtendedDataTableBean.facets['header']}"/>
+ </f:facet>
+
+ <rich:column id="columnState"
sortBy="#{record.state}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState"
value="#{richExtendedDataTableBean.facets['columnStateHeader']}"
+ rendered="#{not empty
richExtendedDataTableBean.facets['columnStateHeader']}"/>
+ </f:facet>
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState"
value="#{richExtendedDataTableBean.facets['columnStateFooter']}"
+ rendered="#{not empty
richExtendedDataTableBean.facets['columnStateFooter']}"/>
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="columnCapital"
sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital"
value="#{richExtendedDataTableBean.facets['columnCapitalHeader']}"
+ rendered="#{not empty
richExtendedDataTableBean.facets['columnCapitalHeader']}"/>
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital"
value="#{richExtendedDataTableBean.facets['columnCapitalFooter']}"
+ rendered="#{not empty
richExtendedDataTableBean.facets['columnCapitalFooter']}"/>
+ </f:facet>
+ </rich:column>
+
+ </rich:extendedDataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:ajax render="richEDT">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="No Data Facet: " />
+ <h:inputText id="noDataInput"
value="#{richExtendedDataTableBean.facets['noData']}" />
+
+ <h:outputLabel value="Caption Facet: " />
+ <h:inputText id="captionInput"
value="#{richExtendedDataTableBean.facets['caption']}" />
+
+ <h:outputLabel value="Header Facet:" />
+ <h:inputText id="headerInput"
value="#{richExtendedDataTableBean.facets['header']}" />
+
+ <h:outputLabel value="State Column Header:" />
+ <h:inputText id="columnStateHeaderInput"
value="#{richExtendedDataTableBean.facets['columnStateHeader']}" />
+
+ <h:outputLabel value="State Column Footer:" />
+ <h:inputText id="columnStateFooterInput"
value="#{richExtendedDataTableBean.facets['columnStateFooter']}" />
+
+ <h:outputLabel value="Capital Column Header:" />
+ <h:inputText id="columnCapitalHeaderInput"
value="#{richExtendedDataTableBean.facets['columnCapitalHeader']}"
/>
+
+ <h:outputLabel value="Capital Column Footer:" />
+ <h:inputText id="columnCapitalFooterInput"
value="#{richExtendedDataTableBean.facets['columnCapitalFooter']}"
/>
+ </h:panelGrid>
+ </a4j:ajax>
+
+ <br/><br/>
+
+ <metamer:attributes
value="#{richExtendedDataTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2010-12-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2010-12-01
18:17:49 UTC (rev 20279)
@@ -129,11 +129,11 @@
<br/>
<h:outputText id="columnHeaderSexType"
value="(filter)" />
<br/>
- <h:selectOneMenu id="columnHeaderSexInput"
value="#{richExtendedDataTableBean.sexFilter}" >
+ <h:selectOneMenu id="columnHeaderSexInput"
value="#{richExtendedDataTableBean.filtering['sex']}" >
<f:selectItem itemValue="ALL"
itemLabel="all"/>
<f:selectItem itemValue="FEMALE"
itemLabel="female"/>
<f:selectItem itemValue="MALE"
itemLabel="male"/>
- <a4j:ajax render="commonGrid"
execute="@this" event="change"/>
+ <a4j:ajax render="commonGrid"
event="change"/>
</h:selectOneMenu>
</h:panelGroup>
</f:facet>
@@ -146,15 +146,15 @@
</rich:column>
- <rich:column id="columnName"
filterValue="#{richExtendedDataTableBean.nameFilter}"
filterExpression="#{fn:containsIgnoreCase(record.name,
richDataTableBean.nameFilter)}">
+ <rich:column id="columnName"
filterExpression="#{fn:containsIgnoreCase(record.name,
richExtendedDataTableBean.filtering['name'])}">
<f:facet name="header">
<h:outputText id="columnHeaderName"
value="Name" />
<br/>
<h:outputText id="columnHeaderNameType"
value="(expression contains ignore case)" />
<br/>
- <h:inputText id="columnHeaderNameInput"
value="#{richExtendedDataTableBean.nameFilter}">
- <a4j:ajax render="commonGrid"
execute="@this" event="change"/>
- </h:inputText>
+ <h:inputText id="columnHeaderNameInput"
value="#{richExtendedDataTableBean.filtering['name']}">
+ <a4j:ajax render="commonGrid"
event="change"/>
+ </h:inputText>
</f:facet>
<h:outputText value="#{record.name}" />
@@ -163,14 +163,14 @@
</f:facet>
</rich:column>
- <rich:column id="columnTitle"
filterValue="#{richExtendedDataTableBean.titleFilter}"
filterExpression="#{richExtendedDataTableBean.titleFilter == null ||
richDataTableBean.titleFilter == '' || record.title ==
richDataTableBean.titleFilter}">
+ <rich:column id="columnTitle"
filterExpression="#{richExtendedDataTableBean.filtering['title'] == null ||
richExtendedDataTableBean.filtering['title'] == '' || record.title ==
richExtendedDataTableBean.filtering['title']}">
<f:facet name="header">
<h:outputText id="columnHeaderTitle"
value="Title" />
<br/>
<h:outputText id="columnHeaderTitleType"
value="(expression equals)" />
<br/>
- <h:inputText id="columnHeaderTitleInput"
value="#{richExtendedDataTableBean.titleFilter}">
- <a4j:ajax render="commonGrid"
execute="@this" event="change"/>
+ <h:inputText id="columnHeaderTitleInput"
value="#{richExtendedDataTableBean.filtering['title']}">
+ <a4j:ajax render="commonGrid"
event="change"/>
</h:inputText>
</f:facet>
@@ -180,13 +180,15 @@
</f:facet>
</rich:column>
- <rich:column id="columnNumberOfKids">
+ <rich:column id="columnNumberOfKids1"
filterExpression="#{empty
richExtendedDataTableBean.filtering['numberOfKids1'] || record.numberOfKids >=
richExtendedDataTableBean.filtering['numberOfKids1']}">
<f:facet name="header">
<h:outputText id="columnHeaderNumberOfKids"
value="Number of Kids" />
<br/>
<h:outputText id="columnHeaderNumberOfKidsType"
value="(expression >=)" />
<br/>
- <rich:inputNumberSpinner id="spinnerFilter"
minValue="0" maxValue="6" value="0"
cycled="true"/>
+ <rich:inputNumberSpinner id="spinnerFilter"
minValue="0" maxValue="6" cycled="false"
value="#{richExtendedDataTableBean.filtering['numberOfKids1']}">
+ <a4j:ajax render="commonGrid" />
+ </rich:inputNumberSpinner>
</f:facet>
<h:outputText value="#{record.numberOfKids}" />
@@ -201,7 +203,11 @@
<br/>
<h:outputText id="columnHeaderNumberOfKids2Type"
value="(expression <)" />
<br/>
- <rich:inputNumberSlider id="sliderFilter"
minValue="0" maxValue="6" value="6"/>
+ <rich:inputNumberSlider id="sliderFilter"
minValue="0" maxValue="6"
value="#{richExtendedDataTableBean.filtering['numberOfKids2']}">
+ <!-- <a4j:ajax render="commonGrid" /> -->
+ </rich:inputNumberSlider>
+ <br />
+ (DOESN'T WORK, NOT REPORTED YET (causes continuous refreshing
of page))
</f:facet>
<h:outputText value="#{record.numberOfKids}" />
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-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml 2010-12-01
18:17:49 UTC (rev 20279)
@@ -35,6 +35,10 @@
Simple page that contains <b>rich:extendedDataTable</b> (with
model containing capitals) and input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="facets" outcome="facets"
value="Facets">
+ Page containing <b>rich:extendedDataTable</b> (with model
containing capitals) and input boxes for all facets dynamically changing.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="scroller" outcome="scroller"
value="Data Scroller">
Page that contains <b>rich:extendedDataTable</b> (with model
containing capitals), data scroller and input boxes for all its attributes.
</metamer:testPageLink>
@@ -57,7 +61,7 @@
<b>rich:extendedDataTable</b> (with model containing states
and capitals) custom sorting by <b>rich:column</b>'s attribute @sortBy,
@sortOrder.
</metamer:testPageLink>
- <metamer:testPageLink id="filtering"
outcome="filtering" value="Table filtering">
+ <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>
</ui:define>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml 2010-12-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml 2010-12-01
18:17:49 UTC (rev 20279)
@@ -56,30 +56,15 @@
<rich:extendedDataTable id="richEDT"
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
-
clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
-
clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
-
filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
-
filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
-
iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
-
iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
-
keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
-
relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
-
rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
-
rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
-
rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
-
rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
-
rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
-
rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].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}"
-
sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
style="#{richExtendedDataTableBean.attributes['style'].value}"
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
value="#{richExtendedDataTableBean.state ?
model.capitals : null}"
@@ -128,72 +113,53 @@
</ui:define>
<ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort
state">
- <rich:componentControl event="click"
target="richEDT" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
+ <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>
- <h:commandButton id="sortCapitalsButton" value="sort
capital">
- <rich:componentControl event="click"
target="richEDT" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
- <h:commandButton id="sortTableButton" value="sort
table">
- <rich:componentControl event="click"
target="richEDT" operation="sort" />
- </h:commandButton>
+ <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>
- <br/><br/>
-
- scroller1:
- <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>
-
- <br/>
-
- scroller2:
- <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>
-
- <br/><br/>
-
<metamer:attributes
value="#{richExtendedDataTableBean.attributes}" id="attributes" />
</ui:define>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml 2010-12-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml 2010-12-01
18:17:49 UTC (rev 20279)
@@ -55,93 +55,35 @@
<rich:extendedDataTable id="richEDT"
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
-
clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
-
clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
-
filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
-
filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
-
iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
-
iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
-
keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
-
relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
-
rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
-
rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
-
rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
-
rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
-
rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
-
rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].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}"
-
sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
style="#{richExtendedDataTableBean.attributes['style'].value}"
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
value="#{richExtendedDataTableBean.state ?
model.capitals : null}"
var="record"
- <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 Header" />
- </f:facet>
-
<h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState"
value="State Footer" />
- </f:facet>
</rich:column>
<rich:column id="columnCapital"
sortBy="#{record.name}">
- <f:facet name="header">
- <h:outputText id="columnHeaderCapital"
value="Capital Header" />
- </f:facet>
-
<h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital"
value="Capital Footer" />
- </f:facet>
</rich:column>
</rich:extendedDataTable>
</ui:define>
<ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort
states">
- <rich:componentControl event="click"
target="richEDT" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
-
- <h:commandButton id="sortCapitalsButton" value="sort
capitals">
- <rich:componentControl event="click"
target="richEDT" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
- <h:commandButton id="sortTableButton" value="sort table">
- <rich:componentControl event="click"
target="richEDT" operation="sort" />
- </h:commandButton>
-
- <br/><br/>
<metamer:attributes
value="#{richExtendedDataTableBean.attributes}" id="attributes" />
</ui:define>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2010-12-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2010-12-01
18:17:49 UTC (rev 20279)
@@ -1,127 +1,158 @@
-<?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="richDataTable scroller1"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- <rich:dataScroller id="scroller1" for="table"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="table"/>
- </ui:define>
-
- <ui:define name="component">
-
- <rich:extendedDataTable id="table"
-
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
-
clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
-
clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
-
filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
-
filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
-
first="#{richExtendedDataTableBean.attributes['first'].value}"
-
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
-
iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
-
iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
-
keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
-
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
-
relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
-
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
-
rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
-
rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
-
rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
-
rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
-
rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
-
rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].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}"
-
sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
-
style="#{richExtendedDataTableBean.attributes['style'].value}"
-
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
- value="#{richExtendedDataTableBean.state ?
model.capitals : null}"
- var="record"
- >
-
- <f:facet name="noData">
- <h:outputText value="There is no data."
style="color: red;"/>
- </f:facet>
-
- <rich:column id="columnState"
sortBy="#{record.state}"
sortOrder="#{richExtendedDataTableBean.statesOrder}">
- <f:facet name="header">
- <a4j:commandLink id="columnHeaderState"
value="State" render="table"
action="#{richExtendedDataTableBean.sortByStates}"/>
- </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}"
sortOrder="#{richExtendedDataTableBean.capitalsOrder}">
- <f:facet name="header">
- <a4j:commandLink id="columnHeaderCapital"
value="Capital" render="table"
action="#{richExtendedDataTableBean.sortByCapitals}"/>
- </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="table"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="table" />
- </f:facet>
-
- </rich:extendedDataTable>
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <metamer:attributes
value="#{richExtendedDataTableBean.attributes}" id="attributes" />
- </ui:define>
-
- </ui:composition>
+<?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"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+
+ <!--
+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-c {
+ height: 30px !important;
+ vertical-align: middle;
+ }
+
+ .rf-edt {
+ width: 820px !important;
+ height: 400px !important;
+ }
+
+ .rf-edt-hdr-c {
+ height: 4.2em !important;
+ }
+
+ .rf-edt-c-columnSex {
+ width: 100px !important;
+ text-align: center;
+ }
+
+ .rf-edt-c-columnName {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnTitle {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids {
+ text-align: center;
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids2 {
+ text-align: center;
+ width: 250px !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="table"/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:extendedDataTable id="richEDT"
+ binding="#{richExtendedDataTableBean.binding}"
+
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.employees : null}"
+ var="record"
+ >
+
+ <f:facet name="noData">
+ <h:outputText value="There is no data."
style="color: red;"/>
+ </f:facet>
+
+ <rich:column id="columnSex" sortBy="#{record.sex}"
sortOrder="#{richExtendedDataTableBean.sorting['columnSex'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortBySex"
value="Sex" render="richEDT"
action="#{richExtendedDataTableBean.sorting['columnSex'].reverseOrder}"
/>
+ </f:facet>
+ <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}" />
+ </rich:column>
+
+
+ <rich:column id="columnName"
sortBy="#{record.name}"
sortOrder="#{richExtendedDataTableBean.sorting['columnName'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortByName" value="Name"
render="richEDT"
action="#{richExtendedDataTableBean.sorting['columnName'].reverseOrder}"
/>
+ </f:facet>
+ <h:outputText value="#{record.name}" />
+ </rich:column>
+
+ <rich:column id="columnTitle"
sortBy="#{record.title}"
sortOrder="#{richExtendedDataTableBean.sorting['columnTitle'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortByTitle" value="Title"
render="richEDT"
action="#{richExtendedDataTableBean.sorting['columnTitle'].reverseOrder}"
/>
+ </f:facet>
+ <h:outputText value="#{record.title}" />
+ </rich:column>
+
+ <rich:column id="columnNumberOfKids"
sortBy="#{record.numberOfKids}"
sortOrder="#{richExtendedDataTableBean.sorting['columnNumberOfKids'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortByNumberOfKids" value="# of
Kids" render="richEDT"
action="#{richExtendedDataTableBean.sorting['columnNumberOfKids'].reverseOrder}"
/>
+ </f:facet>
+ <h:outputText value="#{record.numberOfKids}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2"
for="richEDT" page="#{richExtendedDataTableBean.page}"
maxPages="7" render="table" />
+ </f:facet>
+
+ </rich:extendedDataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+
+ <a4j:commandButton id="sortReset" value="Reset
Sorting" action="#{richExtendedDataTableBean.sorting.clear}"
render="richEDT" />
+
+ <br/><br/>
+
+ <metamer:attributes
value="#{richExtendedDataTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2010-12-01
18:16:38 UTC (rev 20278)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2010-12-01
18:17:49 UTC (rev 20279)
@@ -2,7 +2,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">
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<!--
JBoss, Home of Professional Open Source
@@ -35,10 +36,42 @@
</f:viewParam>
</f:metadata>
<style type="text/css">
+ .rf-edt-c {
+ height: 30px !important;
+ vertical-align: middle;
+ }
+
.rf-edt {
- width: 300px !important;
- height: 300px !important;
+ width: 820px !important;
+ height: 400px !important;
}
+
+ .rf-edt-hdr-c {
+ height: 4.2em !important;
+ }
+
+ .rf-edt-c-columnSex {
+ width: 100px !important;
+ text-align: center;
+ }
+
+ .rf-edt-c-columnName {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnTitle {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids {
+ text-align: center;
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids2 {
+ text-align: center;
+ width: 250px !important;
+ }
</style>
</ui:define>
@@ -49,93 +82,89 @@
<a4j:ajax render="richDataTable scroller1"/>
</h:selectBooleanCheckbox>
<br/><br/>
- <rich:dataScroller id="scroller1" for="table"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="table"/>
+ <rich:dataScroller id="scroller1" for="richEDT"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="table"/>
</ui:define>
<ui:define name="component">
- <rich:extendedDataTable id="table"
+ <rich:extendedDataTable id="richEDT"
+ binding="#{richExtendedDataTableBean.binding}"
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
-
clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
-
clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
-
filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
-
filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
-
iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
-
iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
-
keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
-
relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
-
rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
-
rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
-
rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
-
rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
-
rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
-
rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].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}"
-
sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
style="#{richExtendedDataTableBean.attributes['style'].value}"
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
- value="#{richExtendedDataTableBean.state ?
model.capitals : null}"
+ value="#{richExtendedDataTableBean.state ?
model.employees : null}"
var="record"
<f:facet name="noData">
<h:outputText value="There is no data."
style="color: red;"/>
</f:facet>
-
- <rich:column id="columnState"
sortBy="#{record.state}">
+
+ <rich:column id="columnSex"
sortBy="#{record.sex}">
<f:facet name="header">
- State
+ <h:commandLink id="sortSexes"
value="Sex">
+ <rich:componentControl event="click"
target="richEDT" operation="sort">
+ <f:param value="columnSex" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:graphicImage library="images" name="#{record.sex
== 'MALE' ? 'male.png' : 'female.png'}" />
+ </rich:column>
- <h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState"
value="State" />
+
+ <rich:column id="columnName"
sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:commandLink id="sortByName"
value="Name">
+ <rich:componentControl event="click"
target="richEDT" operation="sort">
+ <f:param value="columnName" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:outputText value="#{record.name}" />
</rich:column>
- <rich:column id="columnCapital"
sortBy="#{record.name}">
+ <rich:column id="columnTitle"
sortBy="#{record.title}">
<f:facet name="header">
- Capital
+ <h:commandLink id="sortByTitle"
value="Title">
+ <rich:componentControl event="click"
target="richEDT" operation="sort">
+ <f:param value="columnTitle" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:outputText value="#{record.title}" />
+ </rich:column>
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital"
value="Capital" />
+ <rich:column id="columnNumberOfKids"
sortBy="#{record.numberOfKids}">
+ <f:facet name="header">
+ <h:commandLink id="sortByNumberOfKids"
value="Number of Kids">
+ <rich:componentControl event="click"
target="richEDT" operation="sort">
+ <f:param value="columnNumberOfKids" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:outputText value="#{record.numberOfKids}" />
</rich:column>
<f:facet name="footer">
- <rich:dataScroller id="scroller2" for="table"
page="#{richExtendedDataTableBean.page}" maxPages="7"
render="table" />
+ <rich:dataScroller id="scroller2"
for="richEDT" page="#{richExtendedDataTableBean.page}"
maxPages="7" render="table" />
</f:facet>
</rich:extendedDataTable>
</ui:define>
<ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort
state">
- <rich:componentControl event="click"
target="table" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
-
- <h:commandButton id="sortCapitalsButton" value="sort
capital">
- <rich:componentControl event="click"
target="table" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
- <h:commandButton id="sortTableButton" value="sort
table">
- <rich:componentControl event="click"
target="table" operation="sort" />
+ <h:commandButton id="sortReset" value="Reset
Sorting">
+ <rich:componentControl event="click"
target="richEDT" operation="sort" />
</h:commandButton>
<br/><br/>