click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1026559 - in /click/trunk/click/framework: src/org/apache/click/control/TablePaginator.java test/org/apache/click/control/TableTest.java
Date Sat, 23 Oct 2010 05:04:05 GMT
Author: sabob
Date: Sat Oct 23 05:04:05 2010
New Revision: 1026559

URL: http://svn.apache.org/viewvc?rev=1026559&view=rev
Log:
Fix CLK-241

Modified:
    click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java
    click/trunk/click/framework/test/org/apache/click/control/TableTest.java

Modified: click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java?rev=1026559&r1=1026558&r2=1026559&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java Sat Oct 23
05:04:05 2010
@@ -192,6 +192,7 @@ public class TablePaginator implements R
             } else {
                 buffer.append(table.getMessage("table-page-links-nobanner", args));
             }
+            controlLink.setTitle(null);
         }
     }
 

Modified: click/trunk/click/framework/test/org/apache/click/control/TableTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/test/org/apache/click/control/TableTest.java?rev=1026559&r1=1026558&r2=1026559&view=diff
==============================================================================
--- click/trunk/click/framework/test/org/apache/click/control/TableTest.java (original)
+++ click/trunk/click/framework/test/org/apache/click/control/TableTest.java Sat Oct 23 05:04:05
2010
@@ -233,4 +233,30 @@ public class TableTest extends TestCase 
         assertEquals(controlLinkParams, table.getControlLink().getParameters());
         assertEquals(linkValue, table.getControlLink().getValue());
     }
+
+    /**
+     * Test CLK-241. Table Headers use incorrect title attribute (table-last-title)
+     * when sortable=true.
+     */
+    public void testNoTitleOnLinkWhenSorting() {
+        MockContext.initContext("/mock.htm");
+
+        List<Foo> foos = new ArrayList<Foo>();
+        foos.add(new Foo("foo1"));
+        foos.add(new Foo("foo2"));
+
+        Table table = new Table("table");
+        table.setPageSize(1);
+        table.setPaginatorAttachment(Table.PAGINATOR_ATTACHED);
+        table.setBannerPosition(Table.POSITION_TOP);
+        table.setSortable(true);
+        table.setRowList(foos);
+        Column column = new Column("name");
+        table.addColumn(column);
+
+        // Test that Name header column does not render a title attribute
+        // that was set by the TablePaginator
+        assertTrue(table.toString().contains("<th class=\"sortable\"><a href=\"/mock/mock.htm?actionLink=table-controlLink&amp;column=name&amp;page=0\">Name"));
+    }
+
 }



Mime
View raw message