Author: mvitenkov
Date: 2008-04-23 13:36:29 -0400 (Wed, 23 Apr 2008)
New Revision: 8098
Modified:
trunk/test-applications/jsp/src/main/java/columns/Columns.java
trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
Log:
sortBy,comparator, column inside columnGroup
Modified: trunk/test-applications/jsp/src/main/java/columns/Columns.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/columns/Columns.java 2008-04-23 15:31:53 UTC
(rev 8097)
+++ trunk/test-applications/jsp/src/main/java/columns/Columns.java 2008-04-23 17:36:29 UTC
(rev 8098)
@@ -1,10 +1,16 @@
package columns;
import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Map;
+import org.richfaces.model.Ordering;
+
+import orderingList.OrderingList;
+
import util.data.Data;
-public class Columns {
+public class Columns implements Comparator{
private String[] statusIcon = { "/pics/error.gif",
"/pics/fatal.gif",
"/pics/info.gif", "/pics/passed.gif", "/pics/warn.gif"
};
private ArrayList<Data> data1;
@@ -16,11 +22,12 @@
private String end;
private String width;
private String title;
+ private Ordering[] orderings = new Ordering[100];
private int colspan;
private int rowspan;
private boolean breakBefore;
private boolean sortable;
- private boolean dataTableRendered;
+ private boolean dataTableRendered;
public Columns() {
this.columns = "3";
this.begin = "0";
@@ -175,4 +182,20 @@
public void setDataTableRendered(boolean dataTableRendered) {
this.dataTableRendered = dataTableRendered;
}
+
+ public Ordering[] getOrderings() {
+ return orderings;
+ }
+
+ public void setOrderings(Ordering[] orderings) {
+ this.orderings = orderings;
+ }
+
+ public int compare(Object arg0, Object arg1) {
+ System.out.println("=====columns comparator work=====");
+ Data data1 = (Data)arg0;
+ Data data2 = (Data)arg1;
+ return data1.getStr0().compareTo(data2.getStr0());
+ }
+
}
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-04-23 15:31:53
UTC (rev 8097)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-04-23 17:36:29
UTC (rev 8098)
@@ -33,8 +33,9 @@
</rich:column>
<rich:columns value="#{columns.data2}" var="d2"
footerClass="#{style.footerClass}" headerClass="#{style.headerClass}"
breakBefore="#{columns.breakBefore}" colspan="#{columns.colspan}"
- columns="#{columns.columns}" index="index"
rowspan="#{columns.rowspan}" sortable="#{columns.sortable}"
- begin="#{columns.begin}" end="#{columns.end}"
width="#{columns.width}" style="#{style.style}"
styleClass="#{style.styleClass}">
+ columns="#{columns.columns}" index="index"
rowspan="#{columns.rowspan}"
+ begin="#{columns.begin}" end="#{columns.end}"
width="#{columns.width}" style="#{style.style}"
styleClass="#{style.styleClass}"
+ comparator="#{columns}" sortBy="#{d2.str0}"
selfSorted="true"
sortOrder="#{columns.orderings[index]}"dir="LTR">
<f:facet name="header">
<h:outputText value="header #{d2.int0}"></h:outputText>
</f:facet>
@@ -93,4 +94,22 @@
<h:outputText value="#{data.str0}"></h:outputText>
</rich:columns>
</rich:dataTable>
+ <rich:spacer height="20" width="150"></rich:spacer>
+
+ <rich:dataTable value="#{columns.data1}" var="cust">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="Data" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+ <rich:column sortBy="#{cust.str0}" selfSorted="true">
+ <h:outputText value="#{cust.str0}"/>
+ <f:facet name="header">
+ <h:outputText value="#1"></h:outputText>
+ </f:facet>
+ </rich:column>
+</rich:dataTable>
+
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-04-23
15:31:53 UTC (rev 8097)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/ColumnsProperty.jsp 2008-04-23
17:36:29 UTC (rev 8098)
@@ -44,14 +44,11 @@
<h:outputText value="width:"></h:outputText>
<h:inputText value="#{columns.width}" onchange="submit();">
- </h:inputText>
-
- <h:outputText value="sortable"></h:outputText>
- <h:selectBooleanCheckbox value="#{columns.sortable}"
onchange="submit();">
- </h:selectBooleanCheckbox>
+ </h:inputText>
<h:outputText value="breakBefore:"></h:outputText>
<h:selectBooleanCheckbox value="#{columns.breakBefore}"
onchange="submit();">
</h:selectBooleanCheckbox>
+
</h:panelGrid>
</f:subview>
\ No newline at end of file
Show replies by date