[richfaces-svn-commits] JBoss Rich Faces SVN: r6077 - in trunk/ui/dataTable/src/main: java/org/richfaces/renderkit and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Feb 14 08:34:34 EST 2008


Author: konstantin.mishin
Date: 2008-02-14 08:34:34 -0500 (Thu, 14 Feb 2008)
New Revision: 6077

Modified:
   trunk/ui/dataTable/src/main/config/component/column.xml
   trunk/ui/dataTable/src/main/config/component/dataTable.xml
   trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
RF-1741

Modified: trunk/ui/dataTable/src/main/config/component/column.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/column.xml	2008-02-14 13:27:08 UTC (rev 6076)
+++ trunk/ui/dataTable/src/main/config/component/column.xml	2008-02-14 13:34:34 UTC (rev 6077)
@@ -90,6 +90,11 @@
 			<classname>java.util.Comparator</classname>
 			<description></description>
 		</property>		
+		<property>
+			<name>selfSorted</name>
+			<classname>boolean</classname>
+			<description></description>
+		</property>		
 		
 		<property elonly="true">
 			<name>filterExpression</name>

Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml	2008-02-14 13:27:08 UTC (rev 6076)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml	2008-02-14 13:34:34 UTC (rev 6077)
@@ -173,5 +173,10 @@
 			<description>HTML: a script expression; a pointer is moved within of row
 			</description>
 		</property>
+		<property>
+			<name>sortPriority</name>
+			<classname>java.util.List</classname>
+			<description></description>
+		</property>
 	</component>
 </components>

Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java	2008-02-14 13:27:08 UTC (rev 6076)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java	2008-02-14 13:34:34 UTC (rev 6077)
@@ -170,21 +170,24 @@
 				writer.writeAttribute("id", clientId, null);
 				if (column.getValueExpression("comparator") != null
 						|| column.getValueExpression("sortExpression") != null) {
-					UIComponent table = column.getParent();
-					String id = table.getClientId(context);
-					JSFunction ajaxFunction = AjaxRendererUtils
-							.buildAjaxFunction(table, context);
-					Map eventOptions = AjaxRendererUtils.buildEventOptions(
-							context, table);
-					Map parameters = (Map) eventOptions.get("parameters");
-					parameters.put(id, SORT_FILTER_PARAMETER);
-					parameters.put(SORT_FILTER_PARAMETER, column
-							.getClientId(context));
-					ajaxFunction.addParameter(eventOptions);
-					StringBuffer buffer = new StringBuffer();
-					ajaxFunction.appendScript(buffer);
-					writer.writeAttribute(HTML.onclick_ATTRIBUTE, buffer
-							.toString(), null);
+					StringBuffer buffer;
+					if (col.isSelfSorted()) {
+						UIComponent table = column.getParent();
+						String id = table.getClientId(context);
+						JSFunction ajaxFunction = AjaxRendererUtils
+								.buildAjaxFunction(table, context);
+						Map eventOptions = AjaxRendererUtils.buildEventOptions(
+								context, table);
+						Map parameters = (Map) eventOptions.get("parameters");
+						parameters.put(id, SORT_FILTER_PARAMETER);
+						parameters.put(SORT_FILTER_PARAMETER, column
+								.getClientId(context));
+						ajaxFunction.addParameter(eventOptions);
+						buffer = new StringBuffer();
+						ajaxFunction.appendScript(buffer);
+						writer.writeAttribute(HTML.onclick_ATTRIBUTE, buffer
+								.toString(), null);
+					}
 					if (Ordering.ASCENDING.equals(col.getSortOrder())) {
 						writer.writeAttribute(HTML.style_ATTRIBUTE,
 								"background-color: red", null);
@@ -497,8 +500,11 @@
 							column.setSortOrder(Ordering.ASCENDING);							
 						}
 					}
-					children.getAttributes().put("filterValue",
-							map.get(children.getClientId(context) + SORT_FILTER_PARAMETER));
+					String filterValue = map.get(children.getClientId(context) + SORT_FILTER_PARAMETER);
+					if (filterValue != null) {
+						children.getAttributes()
+								.put("filterValue", filterValue);
+					}
 				}
 
 			}




More information about the richfaces-svn-commits mailing list