click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r784461 - in /incubator/click/trunk/click: extras/src/org/apache/click/extras/control/FormTable.java framework/src/org/apache/click/control/Table.java framework/src/org/apache/click/control/TablePaginator.java
Date Sat, 13 Jun 2009 20:17:45 GMT
Author: sabob
Date: Sat Jun 13 20:17:45 2009
New Revision: 784461

URL: http://svn.apache.org/viewvc?rev=784461&view=rev
Log:
Enhanced table to invoke controlLink onInit and onRender events. Removed controlLink ID rendering

Modified:
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java
    incubator/click/trunk/click/framework/src/org/apache/click/control/Table.java
    incubator/click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java?rev=784461&r1=784460&r2=784461&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java
(original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/FormTable.java
Sat Jun 13 20:17:45 2009
@@ -356,7 +356,6 @@
     public List getHeadElements() {
         if (headElements == null) {
             headElements = super.getHeadElements();
-            headElements.addAll(getControlLink().getHeadElements());
 
             int firstRow = getFirstRow();
             int lastRow = getLastRow();

Modified: incubator/click/trunk/click/framework/src/org/apache/click/control/Table.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/control/Table.java?rev=784461&r1=784460&r2=784461&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/control/Table.java (original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/control/Table.java Sat Jun
13 20:17:45 2009
@@ -825,6 +825,22 @@
     }
 
     /**
+     * Return the HEAD elements for the Table. The HEAD elements of the
+     * {@link #getControlLink()} will also be included.
+     *
+     * @see org.apache.click.Control#getHtmlImports()
+     *
+     * @return the list of HEAD elements for the Table
+     */
+    public List getHeadElements() {
+        if (headElements == null) {
+            headElements = super.getHeadElements();
+            headElements.addAll(getControlLink().getHeadElements());
+        }
+        return headElements;
+    }
+
+    /**
      * @see Control#setName(String)
      *
      * @param name of the control
@@ -1168,6 +1184,7 @@
      */
     public void onInit() {
         super.onInit();
+        getControlLink().onInit();
         for (int i = 0, size = getControls().size(); i < size; i++) {
             Control control = (Control) getControls().get(i);
             control.onInit();
@@ -1180,6 +1197,7 @@
      * @see org.apache.click.Control#onRender()
      */
     public void onRender() {
+        getControlLink().onRender();
         for (int i = 0, size = getControls().size(); i < size; i++) {
             Control control = (Control) getControls().get(i);
             control.onRender();
@@ -1689,12 +1707,10 @@
                 link.setLabel(firstLabel);
                 link.setParameter(PAGE, String.valueOf(0));
                 link.setAttribute("title", firstTitle);
-                link.setId("control-first");
                 firstLabel = link.toString();
 
                 link.setLabel(previousLabel);
                 link.setParameter(PAGE, String.valueOf(getPageNumber() - 1));
-                link.setId("control-previous");
                 link.setAttribute("title", previousTitle);
                 previousLabel = link.toString();
             }
@@ -1718,7 +1734,6 @@
                     link.setLabel(pageNumber);
                     link.setParameter(PAGE, String.valueOf(i));
                     link.setAttribute("title", gotoTitle + " " + pageNumber);
-                    link.setId("control-" + pageNumber);
                     pagesBuffer.append(link.toString());
                 }
 
@@ -1732,13 +1747,11 @@
                 link.setLabel(nextLabel);
                 link.setParameter(PAGE, String.valueOf(getPageNumber() + 1));
                 link.setAttribute("title", nextTitle);
-                link.setId("control-next");
                 nextLabel = link.toString();
 
                 link.setLabel(lastLabel);
                 link.setParameter(PAGE, String.valueOf(getNumberPages() - 1));
                 link.setAttribute("title", lastTitle);
-                link.setId("control-last");
                 lastLabel = link.toString();
             }
 

Modified: incubator/click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java?rev=784461&r1=784460&r2=784461&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java
(original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/control/TablePaginator.java
Sat Jun 13 20:17:45 2009
@@ -137,13 +137,11 @@
                 controlLink.setLabel(firstLabel);
                 controlLink.setParameter(Table.PAGE, String.valueOf(0));
                 controlLink.setTitle(firstTitle);
-                controlLink.setId("control-first");
                 firstLabel = controlLink.toString();
 
                 controlLink.setLabel(previousLabel);
                 controlLink.setParameter(Table.PAGE, String.valueOf(table.getPageNumber()
- 1));
                 controlLink.setTitle(previousTitle);
-                controlLink.setId("control-previous");
                 previousLabel = controlLink.toString();
             }
 
@@ -166,7 +164,6 @@
                     controlLink.setLabel(pageNumber);
                     controlLink.setParameter(Table.PAGE, String.valueOf(i));
                     controlLink.setTitle(gotoTitle + " " + pageNumber);
-                    controlLink.setId("control-" + pageNumber);
                     controlLink.render(pagesBuffer);
                 }
 
@@ -180,13 +177,11 @@
                 controlLink.setLabel(nextLabel);
                 controlLink.setParameter(Table.PAGE, String.valueOf(table.getPageNumber()
+ 1));
                 controlLink.setTitle(nextTitle);
-                controlLink.setId("control-next");
                 nextLabel = controlLink.toString();
 
                 controlLink.setLabel(lastLabel);
                 controlLink.setParameter(Table.PAGE, String.valueOf(table.getNumberPages()
- 1));
                 controlLink.setTitle(lastTitle);
-                controlLink.setId("control-last");
                 lastLabel = controlLink.toString();
             }
 



Mime
View raw message