Author: ilya_shaikovsky
Date: 2010-05-26 11:11:53 -0400 (Wed, 26 May 2010)
New Revision: 17262
Added:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsFilteringBean.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/ReportBean.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/Capital.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/CapitalsParser.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryItem.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorItem.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorList.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReport.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecord.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecordItem.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/report/
root/examples/richfaces-showcase/trunk/src/main/resources/META-INF/
root/examples/richfaces-showcase/trunk/src/main/resources/META-INF/a4j.taglib.xml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/tableToggleControl/
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/tableToggleControl/tableToggleControl.xhtml
Removed:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/capitals/
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/filter/
Modified:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/UserBean.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CapitalsBean.java
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsBean.java
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableFilteringAPI.xhtml
Log:
https://jira.jboss.org/browse/RF-8694
https://jira.jboss.org/browse/RF-8298
Modified:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/UserBean.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/UserBean.java 2010-05-26
14:58:45 UTC (rev 17261)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/common/UserBean.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -1,10 +1,11 @@
package org.richfaces.demo.common;
import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
@ManagedBean(name = "userBean")
-@ViewScoped
+@SessionScoped
public class UserBean {
private String name = "";
private String email = "";
Modified:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CapitalsBean.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CapitalsBean.java 2010-05-26
14:58:45 UTC (rev 17261)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CapitalsBean.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -6,7 +6,7 @@
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
-import org.richfaces.demo.tables.data.capitals.Capital;
+import org.richfaces.demo.tables.model.capitals.Capital;
@ManagedBean
@SessionScoped
Modified:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsBean.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsBean.java 2010-05-26
14:58:45 UTC (rev 17261)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsBean.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -14,17 +14,16 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.ViewScoped;
+import javax.faces.bean.SessionScoped;
import javax.faces.model.SelectItem;
import org.richfaces.demo.common.data.RandomHelper;
-import org.richfaces.demo.tables.data.carstore.InventoryItem;
-import org.richfaces.demo.tables.data.carstore.InventoryVendorItem;
-import org.richfaces.demo.tables.data.carstore.InventoryVendorList;
-import org.richfaces.demo.tables.filter.CarsFilteringBean;
+import org.richfaces.demo.tables.model.cars.InventoryItem;
+import org.richfaces.demo.tables.model.cars.InventoryVendorItem;
+import org.richfaces.demo.tables.model.cars.InventoryVendorList;
@ManagedBean(name = "carsBean")
-@ViewScoped
+@SessionScoped
public class CarsBean implements Serializable{
/**
*
Copied:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsFilteringBean.java
(from rev 17257,
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/filter/CarsFilteringBean.java)
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsFilteringBean.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/CarsFilteringBean.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,65 @@
+package org.richfaces.demo.tables;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+import org.richfaces.demo.tables.model.cars.InventoryItem;
+import org.richfaces.model.Filter;
+
+@ManagedBean
+@SessionScoped
+public class CarsFilteringBean implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5680001353441022183L;
+ private String vinFilter;
+ private String vendorFilter;
+ private Long mileageFilter;
+
+ public Filter<?> getMileageFilterImpl() {
+ return new Filter<InventoryItem>() {
+ public boolean accept(InventoryItem item) {
+ Long mileage = getMileageFilter();
+ if (mileage == null || mileage.compareTo(item.getMileage().longValue())
>= 0) {
+ return true;
+ }
+ return false;
+ }
+ };
+ }
+
+ public boolean acceptVendor(InventoryItem item) {
+ String vendor = getVendorFilter();
+ if (vendor == null || vendor.length() == 0 || vendor.equals(item.getVendor())) {
+ return true;
+ }
+ return false;
+ }
+
+ public Long getMileageFilter() {
+ return mileageFilter;
+ }
+
+ public void setMileageFilter(Long mileageFilter) {
+ this.mileageFilter = mileageFilter;
+ }
+
+ public String getVendorFilter() {
+ return vendorFilter;
+ }
+
+ public void setVendorFilter(String vendorFilter) {
+ this.vendorFilter = vendorFilter;
+ }
+
+ public String getVinFilter() {
+ return vinFilter;
+ }
+
+ public void setVinFilter(String vinFilter) {
+ this.vinFilter = vinFilter;
+ }
+}
Added:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/ReportBean.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/ReportBean.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/ReportBean.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,22 @@
+package org.richfaces.demo.tables;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+import org.richfaces.demo.tables.model.expenses.ExpenseReport;
+
+@ManagedBean
+@RequestScoped
+public class ReportBean {
+ ExpenseReport expReport;
+
+ public ExpenseReport getExpReport() {
+ if (expReport == null)
+ expReport = new ExpenseReport();
+ return expReport;
+ }
+
+ public void setExpReport(ExpenseReport expReport) {
+ this.expReport = expReport;
+ }
+}
Copied:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/Capital.java
(from rev 17257,
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/capitals/Capital.java)
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/Capital.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/Capital.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,56 @@
+package org.richfaces.demo.tables.model.capitals;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlElement;
+
+public class Capital implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1042449580199397136L;
+
+ private static final String FILE_EXT = ".gif";
+
+ private String name;
+ private String state;
+ private String timeZone;
+
+ public Capital() {
+ }
+
+ @XmlElement
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @XmlElement
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ private String stateNameToFileName() {
+ return state.replaceAll("\\s", "").toLowerCase();
+ }
+
+ public String getStateFlag() {
+ return "/images/capitals/" + stateNameToFileName() + FILE_EXT;
+ }
+
+ @XmlElement
+ public String getTimeZone() {
+ return timeZone;
+ }
+
+ public void setTimeZone(String timeZone) {
+ this.timeZone = timeZone;
+ }
+}
Copied:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/CapitalsParser.java
(from rev 17257,
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/capitals/CapitalsParser.java)
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/CapitalsParser.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/capitals/CapitalsParser.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,53 @@
+package org.richfaces.demo.tables.model.capitals;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.faces.FacesException;
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+
+@ManagedBean
+@ApplicationScoped
+public class CapitalsParser {
+
+ private List<Capital> capitalsList;
+
+ @XmlRootElement(name = "capitals")
+ private static final class CapitalsHolder {
+
+ private List<Capital> capitals;
+
+ @XmlElement(name = "capital")
+ public List<Capital> getCapitals() {
+ return capitals;
+ }
+
+ @SuppressWarnings("unused")
+ public void setCapitals(List<Capital> capitals) {
+ this.capitals = capitals;
+ }
+ }
+
+ public synchronized List<Capital> getCapitalsList() {
+ if (capitalsList == null) {
+ ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+ URL resource =
ccl.getResource("org/richfaces/demo/data/capitals/capitals.xml");
+ JAXBContext context;
+ try {
+ context = JAXBContext.newInstance(CapitalsHolder.class);
+ CapitalsHolder capitalsHolder = (CapitalsHolder)
context.createUnmarshaller().unmarshal(resource);
+ capitalsList = capitalsHolder.getCapitals();
+ } catch (JAXBException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+ return capitalsList;
+ }
+}
Copied:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryItem.java
(from rev 17257,
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/InventoryItem.java)
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryItem.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryItem.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,13 @@
+package org.richfaces.demo.tables.model.cars;
+
+public class InventoryItem extends InventoryVendorItem {
+ private String vendor;
+
+ public String getVendor() {
+ return vendor;
+ }
+
+ public void setVendor(String vendor) {
+ this.vendor = vendor;
+ }
+}
Copied:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorItem.java
(from rev 17257,
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/InventoryVendorItem.java)
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorItem.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorItem.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,132 @@
+package org.richfaces.demo.tables.model.cars;
+
+import java.math.BigDecimal;
+
+public class InventoryVendorItem {
+ BigDecimal activity;
+ BigDecimal changePrice;
+ BigDecimal changeSearches;
+ int daysLive;
+ BigDecimal exposure;
+ BigDecimal inquiries;
+ BigDecimal mileage;
+ BigDecimal mileageMarket;
+ String model;
+ Integer price;
+ BigDecimal priceMarket;
+ BigDecimal printed;
+ String stock;
+ String vin;
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public String getStock() {
+ return stock;
+ }
+
+ public void setStock(String stock) {
+ this.stock = stock;
+ }
+
+ public String getVin() {
+ return vin;
+ }
+
+ public void setVin(String vin) {
+ this.vin = vin;
+ }
+
+ public BigDecimal getMileage() {
+ return mileage;
+ }
+
+ public void setMileage(BigDecimal mileage) {
+ this.mileage = mileage;
+ }
+
+ public BigDecimal getMileageMarket() {
+ return mileageMarket;
+ }
+
+ public void setMileageMarket(BigDecimal mileageMarket) {
+ this.mileageMarket = mileageMarket;
+ }
+
+ public Integer getPrice() {
+ return price;
+ }
+
+ public void setPrice(Integer price) {
+ this.price = price;
+ }
+
+ public BigDecimal getPriceMarket() {
+ return priceMarket;
+ }
+
+ public void setPriceMarket(BigDecimal priceMarket) {
+ this.priceMarket = priceMarket;
+ }
+
+ public int getDaysLive() {
+ return daysLive;
+ }
+
+ public void setDaysLive(int daysLive) {
+ this.daysLive = daysLive;
+ }
+
+ public BigDecimal getChangeSearches() {
+ return changeSearches;
+ }
+
+ public void setChangeSearches(BigDecimal changeSearches) {
+ this.changeSearches = changeSearches;
+ }
+
+ public BigDecimal getChangePrice() {
+ return changePrice;
+ }
+
+ public void setChangePrice(BigDecimal changePrice) {
+ this.changePrice = changePrice;
+ }
+
+ public BigDecimal getExposure() {
+ return exposure;
+ }
+
+ public void setExposure(BigDecimal exposure) {
+ this.exposure = exposure;
+ }
+
+ public BigDecimal getActivity() {
+ return activity;
+ }
+
+ public void setActivity(BigDecimal activity) {
+ this.activity = activity;
+ }
+
+ public BigDecimal getPrinted() {
+ return printed;
+ }
+
+ public void setPrinted(BigDecimal printed) {
+ this.printed = printed;
+ }
+
+ public BigDecimal getInquiries() {
+ return inquiries;
+ }
+
+ public void setInquiries(BigDecimal inquiries) {
+ this.inquiries = inquiries;
+ }
+}
Copied:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorList.java
(from rev 17257,
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/data/carstore/InventoryVendorList.java)
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorList.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/cars/InventoryVendorList.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,37 @@
+package org.richfaces.demo.tables.model.cars;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class InventoryVendorList {
+ private String vendor;
+ private List<InventoryVendorItem> vendorItems;
+
+ public InventoryVendorList() {
+ vendorItems = new ArrayList<InventoryVendorItem>();
+ }
+
+ public long getCount() {
+ if (vendorItems != null) {
+ return vendorItems.size();
+ } else {
+ return 0;
+ }
+ }
+
+ public String getVendor() {
+ return vendor;
+ }
+
+ public void setVendor(String vendor) {
+ this.vendor = vendor;
+ }
+
+ public List<InventoryVendorItem> getVendorItems() {
+ return vendorItems;
+ }
+
+ public void setVendorItems(List<InventoryVendorItem> vendorItems) {
+ this.vendorItems = vendorItems;
+ }
+}
Added:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReport.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReport.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReport.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,77 @@
+package org.richfaces.demo.tables.model.expenses;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class ExpenseReport {
+ private List records = null;
+
+ public List getRecords() {
+ if (records == null) {
+ initRecords();
+ }
+ return records;
+ }
+
+ public void setRecords(List records) {
+ this.records = records;
+ }
+
+ public double getTotalMeals() {
+ double ret = 0.0;
+ Iterator it = getRecords().iterator();
+ while (it.hasNext()) {
+ ExpenseReportRecord record = (ExpenseReportRecord) it.next();
+ ret += record.getTotalMeals();
+ }
+ return ret;
+ }
+
+ public double getTotalHotels() {
+ double ret = 0.0;
+ Iterator it = getRecords().iterator();
+ while (it.hasNext()) {
+ ExpenseReportRecord record = (ExpenseReportRecord) it.next();
+ ret += record.getTotalHotels();
+ }
+ return ret;
+ }
+
+ public double getTotalTransport() {
+ double ret = 0.0;
+ Iterator it = getRecords().iterator();
+ while (it.hasNext()) {
+ ExpenseReportRecord record = (ExpenseReportRecord) it.next();
+ ret += record.getTotalTransport();
+ }
+ return ret;
+ }
+
+ public double getGrandTotal() {
+ return getTotalMeals() + getTotalHotels() + getTotalTransport();
+ }
+
+ public int getRecordsCount() {
+ return getRecords().size();
+ }
+
+ private void initRecords() {
+ records = new ArrayList();
+ ExpenseReportRecord rec;
+ rec = new ExpenseReportRecord();
+ rec.setCity("San Jose");
+ rec.getItems().add(new ExpenseReportRecordItem("25-Aug-97", 37.74,
112.0, 45.0, "San Jose"));
+ rec.getItems().add(new ExpenseReportRecordItem("26-Aug-97", 27.28,
112.0, 45.0, "San Jose"));
+ records.add(rec);
+ rec = new ExpenseReportRecord();
+ rec.setCity("Seattle");
+ rec.getItems().add(new ExpenseReportRecordItem("27-Aug-97", 96.25,
109.0, 36.00, "Seattle"));
+ rec.getItems().add(new ExpenseReportRecordItem("28-Aug-97", 35.0,
109.0, 36.0, "Seattle"));
+ records.add(rec);
+ rec = new ExpenseReportRecord();
+ rec.setCity("new");
+ records.add(rec);
+ }
+
+}
Added:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecord.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecord.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecord.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,64 @@
+package org.richfaces.demo.tables.model.expenses;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class ExpenseReportRecord {
+ private String city;
+ private List items = new ArrayList();
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public List getItems() {
+ return this.items;
+ }
+
+ public void setItems(List items) {
+ this.items = items;
+ }
+
+ public double getTotalMeals() {
+ double ret = 0.0;
+ Iterator it = items.iterator();
+ while (it.hasNext()) {
+ ExpenseReportRecordItem item = (ExpenseReportRecordItem) it.next();
+ ret += item.getMeals();
+ }
+ return ret;
+ }
+
+ public double getTotalHotels() {
+ double ret = 0.0;
+ Iterator it = items.iterator();
+ while (it.hasNext()) {
+ ExpenseReportRecordItem item = (ExpenseReportRecordItem) it.next();
+ ret += item.getHotels();
+ }
+ return ret;
+ }
+
+ public double getTotalTransport() {
+ double ret = 0.0;
+ Iterator it = items.iterator();
+ while (it.hasNext()) {
+ ExpenseReportRecordItem item = (ExpenseReportRecordItem) it.next();
+ ret += item.getTransport();
+ }
+ return ret;
+ }
+
+ public double getTotal() {
+ return getTotalMeals() + getTotalHotels() + getTotalTransport();
+ }
+
+ public int getItemsCount() {
+ return getItems().size();
+ }
+}
Added:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecordItem.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecordItem.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/tables/model/expenses/ExpenseReportRecordItem.java 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,63 @@
+package org.richfaces.demo.tables.model.expenses;
+
+public class ExpenseReportRecordItem {
+
+ private String city;
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ private String day;
+ private double meals;
+ private double hotels;
+ private double transport;
+
+ public ExpenseReportRecordItem(String day, double meals, double hotels, double
transport, String city) {
+ this.city = city;
+ this.day = day;
+ this.meals = meals;
+ this.hotels = hotels;
+ this.transport = transport;
+ }
+
+ public String getDay() {
+ return day;
+ }
+
+ public void setDay(String day) {
+ this.day = day;
+ }
+
+ public double getHotels() {
+ return hotels;
+ }
+
+ public void setHotels(double hotels) {
+ this.hotels = hotels;
+ }
+
+ public double getMeals() {
+ return meals;
+ }
+
+ public void setMeals(double meals) {
+ this.meals = meals;
+ }
+
+ public double getTransport() {
+ return transport;
+ }
+
+ public void setTransport(double transport) {
+ this.transport = transport;
+ }
+
+ public double getTotal() {
+ return meals + hotels + transport;
+ }
+}
Added: root/examples/richfaces-showcase/trunk/src/main/resources/META-INF/a4j.taglib.xml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/resources/META-INF/a4j.taglib.xml
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/resources/META-INF/a4j.taglib.xml 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,927 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0" id="a4j">
+ <
namespace>http://richfaces.org/a4j</namespace>
+ <tag>
+ <tag-name>commandLink</tag-name>
+ <component>
+ <component-type>org.richfaces.CommandLink</component-type>
+ <renderer-type>org.richfaces.CommandLinkRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>action</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>actionExpression</name>
+ <type>javax.el.MethodExpression</type>
+ </attribute>
+ <attribute>
+ <description><p> MethodExpression representing an action
listener method that will be notified when this component is activated by the user. The
expression must evaluate to a public method that takes an ActionEvent parameter, with a
return type of void, <span class="changed_added_2_0">or to a
public method that takes no arguments with a return type of void. In the latter case, the
method has no way of easily knowing where the event came from, but this can be useful in
cases where a notification is needed that "some action
happened".</span> </p></description>
+ <name>actionListener</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating that, if this component is activated by
the user, notifications should be delivered to interested listeners and actions
immediately (that is, during Apply Request Values phase) rather than waiting until Invoke
Application phase.</description>
+ <name>immediate</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>limitRender</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>repeat</tag-name>
+ <component>
+ <component-type>org.richfaces.Repeat</component-type>
+ <renderer-type>org.richfaces.RepeatRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>mediaOutput</tag-name>
+ <component>
+ <component-type>org.richfaces.MediaOutput</component-type>
+ <renderer-type>org.richfaces.MediaOutputRenderer</renderer-type>
+
<handler-class>org.richfaces.view.facelets.html.MediaOutputHandler</handler-class>
+ </component>
+ <attribute>
+ <name>accesskey</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>align</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>archive</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <name>border</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>cacheable</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>charset</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>classid</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>codebase</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>codetype</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Converter instance registered with this
component.</description>
+ <name>converter</name>
+ <type>javax.faces.convert.Converter</type>
+ </attribute>
+ <attribute>
+ <name>coords</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Get EL binding to method in user bean to send resource.
Method will called with two parameters - restored data object and servlet output stream.
@return MethodBinding to createContent</description>
+ <name>createContent</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <name>declare</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>dir</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Get Element name for rendering ( imj , a , object, applet
). @return</description>
+ <name>element</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>expires</name>
+ <type>java.util.Date</type>
+ </attribute>
+ <attribute>
+ <name>hreflang</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>hspace</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ismap</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>lang</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>lastModified</name>
+ <type>java.util.Date</type>
+ </attribute>
+ <attribute>
+ <name>mimeType</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onblur</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onfocus</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>rel</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>rev</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>shape</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>standby</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>tabindex</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>target</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>title</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>type</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Get URI attribute for resource ( src for images, href for
links etc ). @return</description>
+ <name>uriAttribute</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>usemap</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <name>vspace</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>attachQueue</tag-name>
+ <component>
+ <component-type>org.richfaces.AttachQueue</component-type>
+ <renderer-type>org.richfaces.AttachQueueRenderer</renderer-type>
+
<handler-class>org.richfaces.view.facelets.html.AttachQueueHandler</handler-class>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ignoreDupResponses</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>onrequestdequeue</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onrequestqueue</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>queueId</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>requestDelay</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <name>requestGroupingId</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>timeout</name>
+ <type>int</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>region</tag-name>
+ <component>
+ <component-type>org.richfaces.Region</component-type>
+ <renderer-type>org.richfaces.RegionRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>status</tag-name>
+ <component>
+ <component-type>org.richfaces.Status</component-type>
+ <renderer-type>org.richfaces.StatusRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>Converter instance registered with this
component.</description>
+ <name>converter</name>
+ <type>javax.faces.convert.Converter</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onerror</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onstart</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onstop</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onsuccess</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>push</tag-name>
+ <component>
+ <component-type>org.richfaces.Push</component-type>
+ <renderer-type>org.richfaces.PushRenderer</renderer-type>
+
<handler-class>org.richfaces.view.facelets.html.AjaxPushHandler</handler-class>
+ </component>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>action</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>actionExpression</name>
+ <type>javax.el.MethodExpression</type>
+ </attribute>
+ <attribute>
+ <description><p> MethodExpression representing an action
listener method that will be notified when this component is activated by the user. The
expression must evaluate to a public method that takes an ActionEvent parameter, with a
return type of void, <span class="changed_added_2_0">or to a
public method that takes no arguments with a return type of void. In the latter case, the
method has no way of easily knowing where the event came from, but this can be useful in
cases where a notification is needed that "some action
happened".</span> </p></description>
+ <name>actionListener</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <name>enabled</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>eventProducer</name>
+ <type>javax.el.MethodExpression</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating that, if this component is activated by
the user, notifications should be delivered to interested listeners and actions
immediately (that is, during Apply Request Values phase) rather than waiting until Invoke
Application phase.</description>
+ <name>immediate</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>@return time in mc for polling
interval.</description>
+ <name>interval</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <name>onbeforedomupdate</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onbegin</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>oncomplete</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ondataavailable</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>commandButton</tag-name>
+ <component>
+ <component-type>org.richfaces.CommandButton</component-type>
+
<renderer-type>org.richfaces.CommandButtonRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>action</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>actionExpression</name>
+ <type>javax.el.MethodExpression</type>
+ </attribute>
+ <attribute>
+ <description><p> MethodExpression representing an action
listener method that will be notified when this component is activated by the user. The
expression must evaluate to a public method that takes an ActionEvent parameter, with a
return type of void, <span class="changed_added_2_0">or to a
public method that takes no arguments with a return type of void. In the latter case, the
method has no way of easily knowing where the event came from, but this can be useful in
cases where a notification is needed that "some action
happened".</span> </p></description>
+ <name>actionListener</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating that, if this component is activated by
the user, notifications should be delivered to interested listeners and actions
immediately (that is, during Apply Request Values phase) rather than waiting until Invoke
Application phase.</description>
+ <name>immediate</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>limitRender</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>outputPanel</tag-name>
+ <component>
+ <component-type>org.richfaces.OutputPanel</component-type>
+ <renderer-type>org.richfaces.OutputPanelRenderer</renderer-type>
+ </component>
+ <attribute>
+ <name>ajaxRendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <name>dir</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>keepTransient</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>lang</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>layout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ondblclick</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeydown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeypress</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onkeyup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousedown</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmousemove</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseout</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseover</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onmouseup</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>title</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>jsFunction</tag-name>
+ <component>
+ <component-type>org.richfaces.Function</component-type>
+ <renderer-type>org.richfaces.FunctionRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>action</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>MethodExpression representing the application action to
invoke when this component is activated by the user. The expression must evaluate to a
public method that takes no parameters, and returns an Object (the toString() of which is
called to derive the logical outcome) which is passed to the NavigationHandler for this
application.</description>
+ <name>actionExpression</name>
+ <type>javax.el.MethodExpression</type>
+ </attribute>
+ <attribute>
+ <description><p> MethodExpression representing an action
listener method that will be notified when this component is activated by the user. The
expression must evaluate to a public method that takes an ActionEvent parameter, with a
return type of void, <span class="changed_added_2_0">or to a
public method that takes no arguments with a return type of void. In the latter case, the
method has no way of easily knowing where the event came from, but this can be useful in
cases where a notification is needed that "some action
happened".</span> </p></description>
+ <name>actionListener</name>
+ <type>javax.faces.el.MethodBinding</type>
+ </attribute>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <name>execute</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating that, if this component is activated by
the user, notifications should be delivered to interested listeners and actions
immediately (that is, during Apply Request Values phase) rather than waiting until Invoke
Application phase.</description>
+ <name>immediate</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>limitRender</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onbeforedomupdate</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onbegin</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>oncomplete</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>render</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>status</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>The current value of this component.</description>
+ <name>value</name>
+ <type>java.lang.Object</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>log</tag-name>
+ <component>
+ <component-type>org.richfaces.AjaxLog</component-type>
+ <renderer-type>org.richfaces.AjaxLogRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>level</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>style</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>styleClass</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>queue</tag-name>
+ <component>
+ <component-type>org.richfaces.Queue</component-type>
+ <renderer-type>org.richfaces.QueueRenderer</renderer-type>
+ </component>
+ <attribute>
+ <description>The value binding expression used to wire up this
component to a component property of a JavaBean class</description>
+ <name>binding</name>
+ <type>javax.faces.component.UIComponent</type>
+ </attribute>
+ <attribute>
+ <description>The component identifier for this component. This value
must be unique within the closest parent component that is a naming
container.</description>
+ <name>id</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>ignoreDupResponses</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>name</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onbeforedomupdate</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>oncomplete</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onerror</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onevent</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onrequestdequeue</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onrequestqueue</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>onsubmit</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>Flag indicating whether or not this component should be
rendered (during Render Response Phase), or processed on any subsequent form submit. The
default value for this property is true.</description>
+ <name>rendered</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <name>requestDelay</name>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <name>status</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>timeout</name>
+ <type>int</type>
+ </attribute>
+ </tag>
+ <tag>
+ <tag-name>ajax</tag-name>
+ <behavior>
+ <behavior-id>org.ajax4jsf.behavior.Ajax</behavior-id>
+
<handler-class>org.richfaces.view.facelets.html.AjaxHandler</handler-class>
+ </behavior>
+ </tag>
+</facelet-taglib>
Modified:
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-05-26
14:58:45 UTC (rev 17261)
+++
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-05-26
15:11:53 UTC (rev 17262)
@@ -214,6 +214,16 @@
</sample>
</samples>
</demo>
+ <demo>
+ <id>tableToggleControl</id>
+ <name>rich:tableToggleControl</name>
+ <samples>
+ <sample>
+ <id>tableToggleControl</id>
+ <name>Table Basic Usage</name>
+ </sample>
+ </samples>
+ </demo>
</demos>
</group>
</root>
Modified:
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml 2010-05-26
14:58:45 UTC (rev 17261)
+++
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/commandLink/commandLink.xhtml 2010-05-26
15:11:53 UTC (rev 17262)
@@ -26,7 +26,7 @@
</h:form>
<br />
<a4j:outputPanel id="out">
- <h:outputText value="Hello #{userBean.name} !" rendered="#{not empty
userBean.name}" styleClass="outhello" />
+ <h:outputText value="Hello #{userBean.name} !"
styleClass="outhello" />
</a4j:outputPanel>
</ui:composition>
</html>
\ No newline at end of file
Modified:
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml 2010-05-26
14:58:45 UTC (rev 17261)
+++
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/simpleTable.xhtml 2010-05-26
15:11:53 UTC (rev 17262)
@@ -8,74 +8,118 @@
xmlns:ds="http://richfaces.org/datascroller">
<ui:composition>
-<p>This sample shows simple master-detail table implemented using<b>
rich:dataTable</b> and<b> rich:subtable</b> components</p>
-<p>There is one feature which is completely new for 4.x - subtables now could be
collapsed/expanded by using
-new component <b>rich:tableToggleControl</b></p>
-<p>subTable's could be collapsed/expanded in different modes defined via
subTable expandMode attribute
-- "<i>client</i>", "<i>ajax</i>" and
"<i>server</i>"</p>
-<p>Also the developer could get control on states of subTables using its
<b>expanded</b> attribute.</p>
- <h:form>
- <tbl:dataTable value="#{carsBean.inventoryVendorLists}"
var="list">
- <f:facet name="header">
- <tbl:columnGroup>
- <tbl:column colspan="6">
- <h:outputText value="Cars marketplace" />
- </tbl:column>
- <tbl:column breakBefore="true">
- <h:outputText value="Model" />
- </tbl:column>
- <tbl:column>
- <h:outputText value="Price" />
- </tbl:column>
- <tbl:column>
- <h:outputText value="Mileage" />
- </tbl:column>
- <tbl:column>
- <h:outputText value="VIN Code" />
- </tbl:column>
- <tbl:column>
- <h:outputText value="Items stock" />
- </tbl:column>
- <tbl:column>
- <h:outputText value="Days Live" />
- </tbl:column>
- </tbl:columnGroup>
- </f:facet>
- <tbl:column colspan="6">
- <h:outputText value="#{list.vendor}" />
- <tbl:toggleControl for="sbtbl">
- <f:facet name="expand">
- <a href="#">(show details)</a>
+ <p>This sample shows simple master-detail table implemented using<b>
+ tbl:dataTable</b> and<b> tbl:subtable</b> components</p>
+ <tbl:dataTable width="700" var="record"
+ value="#{reportBean.expReport.records}">
+ <f:facet name="header">
+ <tbl:columnGroup>
+ <tbl:column rowspan="2">
+ </tbl:column>
+ <tbl:column colspan="3">
+ <h:outputText value="Expenses" />
+ </tbl:column>
+ <tbl:column rowspan="2">
+ <h:outputText value="subtotals" />
+ </tbl:column>
+ <tbl:column breakBefore="true">
+ <h:outputText value="Meals" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="Hotels" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="Transport" />
+ </tbl:column>
+ </tbl:columnGroup>
+ </f:facet>
+
+ <tbl:column colspan="5">
+ <h:outputText value="#{record.city}" />
+ </tbl:column>
+
+ <tbl:subTable var="expense" value="#{record.items}">
+ <tbl:column>
+ <h:outputText value="#{expense.day}"></h:outputText>
+ <f:facet name="footer">
+ <div></div>
</f:facet>
- <f:facet name="collapse">
- <a href="#">(hide details)</a>
+ </tbl:column>
+ <tbl:column>
+ <f:facet name="header">
+ <h:outputText value="#{record.totalMeals}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
</f:facet>
- </tbl:toggleControl>
- </tbl:column>
- <tbl:subTable value="#{list.vendorItems}" var="item"
id="sbtbl" expandMode="client">
- <tbl:column>
- <h:outputText value="#{item.model}" />
+ <h:outputText value="#{expense.meals}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="#{record.totalMeals}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
+ </f:facet>
</tbl:column>
<tbl:column>
- <h:outputText value="#{item.price}" />
+ <h:outputText value="#{expense.hotels}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="#{record.totalHotels}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
+ </f:facet>
</tbl:column>
+
+ <tbl:column>
+ <h:outputText value="#{expense.transport}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
+ <f:facet name="footer">
+ <h:outputText value="#{record.totalTransport}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
+ </f:facet>
+ </tbl:column>
+ <tbl:column>
+
+ <f:facet name="footer">
+ <h:outputText value="#{record.total}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
+ </f:facet>
+ </tbl:column>
+
+ </tbl:subTable>
+
+ <f:facet name="footer">
+
+ <tbl:columnGroup>
+ <tbl:column>Totals</tbl:column>
<tbl:column>
- <h:outputText value="#{item.mileage}" />
+ <h:outputText value="#{report.expReport.totalMeals}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
</tbl:column>
<tbl:column>
- <h:outputText value="#{item.vin}" />
+ <h:outputText value="#{report.expReport.totalHotels}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
</tbl:column>
<tbl:column>
- <h:outputText value="#{item.stock}" />
+ <h:outputText value="#{report.expReport.totalTransport}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
</tbl:column>
<tbl:column>
- <h:outputText value="#{item.daysLive}" />
+ <h:outputText value="#{report.expReport.grandTotal}">
+ <f:convertNumber pattern="$####.00" />
+ </h:outputText>
</tbl:column>
- <f:facet name="footer">
- <h:outputText value="Total of #{list.vendor} Cars: #{list.count}"
/>
- </f:facet>
- </tbl:subTable>
- </tbl:dataTable>
- </h:form>
+ </tbl:columnGroup>
+ </f:facet>
+
+ </tbl:dataTable>
+
</ui:composition>
</html>
\ No newline at end of file
Modified:
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableFilteringAPI.xhtml
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableFilteringAPI.xhtml 2010-05-26
14:58:45 UTC (rev 17261)
+++
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/dataTable/tableFilteringAPI.xhtml 2010-05-26
15:11:53 UTC (rev 17262)
@@ -19,7 +19,7 @@
<ul>
<a4j:repeat value="#{carsBean.allVendors}" var="vendor">
<li><h:outputLink
- value="javascript:document.getElementById('form:table').component.filter('vendor',
'#{vendor}')">#{vendor}</h:outputLink>
+ value="javascript:document.getElementById('form:table').richfaces.component.filter('vendor',
'#{vendor}')">#{vendor}</h:outputLink>
</li>
</a4j:repeat>
</ul>
Added:
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/tableToggleControl/tableToggleControl.xhtml
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/tableToggleControl/tableToggleControl.xhtml
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/tableToggleControl/tableToggleControl.xhtml 2010-05-26
15:11:53 UTC (rev 17262)
@@ -0,0 +1,84 @@
+<!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:tbl="http://richfaces.org/rich"
+
xmlns:ds="http://richfaces.org/datascroller">
+
+<ui:composition>
+<p>This sample shows simple master-detail table implemented using<b>
rich:dataTable</b> and<b> rich:subtable</b> components</p>
+<p>There is one feature which is completely new for 4.x - subtables now could be
collapsed/expanded by using
+new component <b>rich:tableToggleControl</b></p>
+<p>Switching customization:</p>
+<ul>
+<li>subTable's could be collapsed/expanded in different modes defined via
subTable expandMode attribute
+- "<i>client</i>", "<i>ajax</i>" and
"<i>server</i>"</li>
+<li>The developer could get control on current states of subTables using its
<b>expanded</b> attribute.</li>
+</ul>
+ <h:form>
+ <tbl:dataTable value="#{carsBean.inventoryVendorLists}"
var="list">
+ <f:facet name="header">
+ <tbl:columnGroup>
+ <tbl:column colspan="6">
+ <h:outputText value="Cars marketplace" />
+ </tbl:column>
+ <tbl:column breakBefore="true">
+ <h:outputText value="Model" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="Price" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="Mileage" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="VIN Code" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="Items stock" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="Days Live" />
+ </tbl:column>
+ </tbl:columnGroup>
+ </f:facet>
+ <tbl:column colspan="6">
+ <h:outputText value="#{list.vendor}" />
+ <tbl:toggleControl for="sbtbl">
+ <f:facet name="expand">
+ <a href="#">(show details)</a>
+ </f:facet>
+ <f:facet name="collapse">
+ <a href="#">(hide details)</a>
+ </f:facet>
+ </tbl:toggleControl>
+ </tbl:column>
+ <tbl:subTable value="#{list.vendorItems}" var="item"
id="sbtbl" expandMode="client">
+ <tbl:column>
+ <h:outputText value="#{item.model}" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="#{item.price}" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="#{item.mileage}" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="#{item.vin}" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="#{item.stock}" />
+ </tbl:column>
+ <tbl:column>
+ <h:outputText value="#{item.daysLive}" />
+ </tbl:column>
+ <f:facet name="footer">
+ <h:outputText value="Total of #{list.vendor} Cars: #{list.count}"
/>
+ </f:facet>
+ </tbl:subTable>
+ </tbl:dataTable>
+ </h:form>
+</ui:composition>
+</html>
\ No newline at end of file