You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gr...@apache.org on 2006/06/03 00:12:32 UTC

svn commit: r411310 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java

Author: grantsmith
Date: Fri Jun  2 15:12:31 2006
New Revision: 411310

URL: http://svn.apache.org/viewvc?rev=411310&view=rev
Log:
TOMAHAWK-423: patch applied


Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java?rev=411310&r1=411309&r2=411310&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java Fri Jun  2 15:12:31 2006
@@ -484,7 +484,7 @@
                 
                 //replace header facet with a sortable header component if needed
                 if (replaceHeaderFacets && isSortHeaderNeeded(aColumn, headerFacet))
-                {
+                {                    
                     propertyName = propertyName != null ? propertyName : getSortPropertyFromEL(aColumn);
                     
                     HtmlCommandSortHeader sortHeader = createSortHeaderComponent(context, aColumn, headerFacet, propertyName);                        
@@ -502,7 +502,7 @@
                 
                 //make the column marked as default sorted be the current sorted column
                 if (defaultSorted && getSortColumn() == null)
-                {
+                {                    
                     setSortColumn(columnName);
                     setSortProperty(propertyName);
                 }
@@ -546,16 +546,16 @@
     protected String getSortPropertyFromEL(UIComponent component)
     {        
         if (getVar() == null)
-            return null;
+            return null;               
         
         for (Iterator iter = component.getChildren().iterator(); iter.hasNext();)
         {
-            UIComponent aChild = (UIComponent) iter.next();
-            if (aChild instanceof UIOutput)
+            UIComponent aChild = (UIComponent) iter.next();            
+            if (aChild.isRendered() && aChild instanceof UIOutput)
             {
                 UIOutput output = (UIOutput)aChild;
                 
-                ValueBinding vb = output.getValueBinding("value"); 
+                ValueBinding vb = output.getValueBinding("value");                 
                 if (vb != null)
                 {
                     String expressionString = vb.getExpressionString();
@@ -567,12 +567,12 @@
                         String tempProp = expressionString.substring(varEndIndex + 1, expressionString.length()); 
                         
                         StringTokenizer tokenizer = new StringTokenizer(tempProp, " +[]{}-/*|?:&<>!=()%");
-                        if (tokenizer.hasMoreTokens())
-                            return tokenizer.nextToken();
+                        if (tokenizer.hasMoreTokens())                        
+                            return tokenizer.nextToken();                                                    
                     }
                 }
             }
-            else getSortPropertyFromEL(aChild);
+            else return getSortPropertyFromEL(aChild);
         }
         
         return null;
@@ -985,7 +985,7 @@
     
     public void setSortProperty(String sortProperty)
     {        
-        _sortProperty = sortProperty;                 
+        _sortProperty = sortProperty;           
     }
 
     public String getSortProperty()