Author: andrei_exadel
Date: 2008-03-11 10:04:37 -0400 (Tue, 11 Mar 2008)
New Revision: 6692
Added:
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java
Modified:
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
trunk/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml
Log:
RF-2413
Modified: trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java
===================================================================
---
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11
14:03:41 UTC (rev 6691)
+++
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Bean.java 2008-03-11
14:04:37 UTC (rev 6692)
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.Map;
+import org.richfaces.model.Ordering;
+
/**
* @author k
*
@@ -104,11 +106,13 @@
private void initColumns () {
String header;
String footer;
+ Ordering ordering = Ordering.UNSORTED;
for (int i = 0; i < columnsCount; i++) {
header = "Header" + Integer.toString(i);
footer = "Footer" + Integer.toString(i);
- Facet facet = new Facet(header,footer);
- columns.add(facet);
+ Column column = new Column(header, footer, ordering);
+ //Facet facet = new Facet(header,footer);
+ columns.add(column);
}
}
@@ -121,14 +125,8 @@
return arr;
}
- private void initMap(Map map, int row) {
-// Iterator it = columns.iterator();
-// while (it.hasNext()) {
-// String column = (String) it.next();
-// map.put(column, column + row);
-// }
- }
+
/**
* @return the model
*/
Added: trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java
===================================================================
--- trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java
(rev 0)
+++
trunk/samples/columnsDemo/src/main/java/org/richfaces/sandbox/samples/Column.java 2008-03-11
14:04:37 UTC (rev 6692)
@@ -0,0 +1,81 @@
+/*
+ * Column.java Date created: 11.03.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.sandbox.samples;
+
+import org.richfaces.model.Ordering;
+
+/**
+ * TODO Class description goes here.
+ * @author "Andrey Markavtsov"
+ *
+ */
+public class Column {
+
+ private String header;
+
+ private String footer;
+
+ private Ordering ordering;
+
+ /**
+ * TODO Description goes here.
+ * @param header
+ * @param footer
+ * @param ordering
+ */
+ public Column(String header, String footer, Ordering ordering) {
+ super();
+ this.header = header;
+ this.footer = footer;
+ this.ordering = ordering;
+ }
+
+ /**
+ * @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/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-11 14:03:41
UTC (rev 6691)
+++ trunk/samples/columnsDemo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-11 14:04:37
UTC (rev 6692)
@@ -7,6 +7,11 @@
<managed-bean-class>org.richfaces.sandbox.samples.Bean</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>columns</managed-bean-name>
+
<managed-bean-class>org.richfaces.sandbox.samples.Columns</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<display-name>xhtml</display-name>
<navigation-case>
Modified: trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml 2008-03-11 14:03:41 UTC
(rev 6691)
+++ trunk/samples/columnsDemo/src/main/webapp/pages/index.xhtml 2008-03-11 14:04:37 UTC
(rev 6692)
@@ -14,33 +14,48 @@
Columns: <h:inputText
value="#{bean.columnsCountStr}"></h:inputText> <br/>
Rows: <h:inputText value="#{bean.rowCountStr}"></h:inputText>
<br/>
-
+
+
+ <a4j:commandButton value="Submit" action="#{bean.xhtml}"
reRender="tb"></a4j:commandButton>
+
+ <br/>
- <a4j:commandButton value="Submit" action="#{bean.xhtml}"
reRender="tb"></a4j:commandButton>
-
- <br/>
-
<dt:dataTable value="#{bean.model}" var="var"
id="tb">
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <h:outputText value="crack"></h:outputText>
+ </dt:column>
<columns:columns value="#{bean.columns}" var="col"
index="counter"
- style="color: Red;" width="100px;">
- <f:facet name="header">
- <h:outputText value="#{col.header}"></h:outputText>
- </f:facet>
- <f:facet name="footer">
- <h:outputText value="#{col.footer}"></h:outputText>
- </f:facet>
+ style="color: Blue; text-align: right;" width="200px;"
+ begin="0" end="10"
+ sortBy="#{var[counter]}" sortOrder="#{col.ordering}">
+ <f:facet name="header">
+ <h:outputText value="#{col.header}"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="#{col.footer}"></h:outputText>
+ </f:facet>
<h:outputText value="#{var[counter]}"></h:outputText>
- <h:inputText value="#{var[counter]}"></h:inputText>
</columns:columns>
+
+ <dt:column>
+ <f:facet name="header">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="crack"></h:outputText>
+ </f:facet>
+ <h:outputText value="crack"></h:outputText>
+ </dt:column>
</dt:dataTable>
- <dt:dataTable value="#{bean.model}" var="var"
id="tb2">
- <columns:columns end="#{bean.columnsCountStr}" var="col"
index="counter"
- style="color: Red;" width="100px;">
- <h:outputText value="#{var[counter]}"></h:outputText>
- </columns:columns>
- </dt:dataTable>
+ <h:commandButton value="Submit"
action="xhtml"></h:commandButton>
</h:form>
Show replies by date