Author: andrei_exadel
Date: 2008-05-20 05:07:38 -0400 (Tue, 20 May 2008)
New Revision: 8647
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/model/
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/model/Column.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/dataTable/
trunk/test-applications/seleniumTest/src/main/webapp/pages/dataTable/dataTableTest.xhtml
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
Log:
dataTable test
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DataTableBean.java 2008-05-20
09:07:38 UTC (rev 8647)
@@ -0,0 +1,127 @@
+package org.ajax4jsf;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.model.Column;
+import org.richfaces.model.Ordering;
+
+@SuppressWarnings("unchecked")
+public class DataTableBean {
+
+ private int rows = 20;
+
+ private int column = 1;
+
+ private List model;
+
+ private List columns;
+
+ private Ordering ordering;
+
+ public DataTableBean() {
+ init();
+ }
+
+ public void init(ActionEvent event) {
+ init();
+ }
+
+ public String getDate() {
+ return new Date().toLocaleString();
+ }
+
+ private void init() {
+ model = new ArrayList();
+ for (int i = 0; i < rows; i++) {
+ String [] m = new String[column];
+ for (int j = 0; j < column; j++) {
+ m[j] = String.valueOf(i + j);
+ }
+ model.add(m);
+ }
+
+ columns = new ArrayList();
+ for (int i = 0; i < column; i++) {
+ columns.add(new Column("Header_" + i,"Footer_" + i));
+ }
+ }
+
+ /**
+ * @return the columns
+ */
+ public int getColumn() {
+ return column;
+ }
+
+ /**
+ * @param columns
+ * the columns to set
+ */
+ public void setColumn(int column) {
+ this.column = column;
+ }
+
+ /**
+ * @return the rows
+ */
+ public int getRows() {
+ return rows;
+ }
+
+ /**
+ * @param rows
+ * the rows to set
+ */
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+
+ /**
+ * @return the model
+ */
+ public List getModel() {
+ return model;
+ }
+
+ /**
+ * @param model
+ * the model to set
+ */
+ public void setModel(List model) {
+ this.model = model;
+ }
+
+ /**
+ * @return the columns
+ */
+ public List getColumns() {
+ return columns;
+ }
+
+ /**
+ * @param columns
+ * the columns to set
+ */
+ public void setColumns(List columns) {
+ this.columns = columns;
+ }
+
+ /**
+ * @return the ordering
+ */
+ public Ordering getOrdering() {
+ return ordering;
+ }
+
+ /**
+ * @param ordering the ordering to set
+ */
+ public void setOrdering(Ordering ordering) {
+ this.ordering = ordering;
+ }
+
+}
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/model/Column.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/model/Column.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/model/Column.java 2008-05-20
09:07:38 UTC (rev 8647)
@@ -0,0 +1,68 @@
+package org.ajax4jsf.model;
+
+import org.richfaces.model.Ordering;
+
+public class Column {
+
+ private String header;
+
+ private String footer;
+
+ private Ordering ordering;
+
+
+ /**
+ * @param header
+ * @param footer
+ */
+ public Column(String header, String footer) {
+ super();
+ this.header = header;
+ this.footer = footer;
+ }
+
+ /**
+ * @return the header
+ */
+ public String getHeader() {
+ return header;
+ }
+
+ /**
+ * @param header the header to set
+ */
+ public void setHeader(String header) {
+ this.header = header;
+ }
+
+ /**
+ * @return the footer
+ */
+ public String getFooter() {
+ return footer;
+ }
+
+ /**
+ * @param footer the footer to set
+ */
+ public void setFooter(String footer) {
+ this.footer = footer;
+ }
+
+ /**
+ * @return the ordering
+ */
+ public Ordering getOrdering() {
+ return ordering;
+ }
+
+ /**
+ * @param ordering the ordering to set
+ */
+ public void setOrdering(Ordering ordering) {
+ this.ordering = ordering;
+ }
+
+
+
+}
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-20
08:16:28 UTC (rev 8646)
+++
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-20
09:07:38 UTC (rev 8647)
@@ -101,5 +101,10 @@
<managed-bean-name>orderingListBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.OrderingListTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>dataTableBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.DataTableBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
\ No newline at end of file
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/dataTable/dataTableTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/pages/dataTable/dataTableTest.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/webapp/pages/dataTable/dataTableTest.xhtml 2008-05-20
09:07:38 UTC (rev 8647)
@@ -0,0 +1,35 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+ <h:form id="_controls">
+ <a4j:commandLink value="Rerender" id="apply2"
reRender="table1, date"></a4j:commandLink>
+ </h:form>
+ <h:form id="_form">
+ <h:outputText id="date"
value="#{dataTableBean.date}"></h:outputText>
+
+ <rich:dataTable value="#{dataTableBean.model}" id="table1"
var="var">
+ <rich:column sortBy="#{var[0]}"
sortOrder="#{dataTableBean.ordering}">
+ <f:facet name="header">
+ <h:outputText value="header"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="footer"></h:outputText>
+ </f:facet>
+ <h:inputText value="#{var[0]}"></h:inputText>
+ <h:outputText value="#{var[0]}"></h:outputText>
+ </rich:column>
+ </rich:dataTable>
+ <br/>
+
+ </h:form>
+
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file