You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/07/07 10:23:13 UTC

svn commit: r554158 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java

Author: bommel
Date: Sat Jul  7 01:23:13 2007
New Revision: 554158

URL: http://svn.apache.org/viewvc?view=rev&rev=554158
Log:
(TOBAGO-437) Exception when sorting on column with tc:link

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java?view=diff&rev=554158&r1=554157&r2=554158
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/Sorter.java Sat Jul  7 01:23:13 2007
@@ -106,14 +106,14 @@
             }
 
           } else {
-            LOG.error("No sortable component found!");
-            removeSortableAttribute(column);
+            LOG.error("No sorting performed. Value is not instanceof List or Object[]!");
+            unsetSortableAttribute(column);
             return null;
           }
         } catch (Exception e) {
           LOG.error("Error while extracting sortMethod :" + e.getMessage(), e);
           if (column != null) {
-            removeSortableAttribute(column);
+            unsetSortableAttribute(column);
           }
           return null;
         }
@@ -141,9 +141,9 @@
     return expressionString.matches("^#\\{(\\w+(\\.\\w)*)\\}$");
   }
 
-  private void removeSortableAttribute(UIColumn uiColumn) {
+  private void unsetSortableAttribute(UIColumn uiColumn) {
     LOG.warn("removing attribute sortable from column " + uiColumn.getId());
-    uiColumn.getAttributes().remove(ATTR_SORTABLE);
+    uiColumn.getAttributes().put(ATTR_SORTABLE, Boolean.FALSE);
   }
 
   private UIComponent getFirstSortableChild(List children) {