click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1052502 - in /click/trunk/click/examples/src/org/apache/click/examples/page/panel: FilterPanelDemo.java ListPanelDemo.java PanelColumn.java PanelColumnDemo.java SimplePanelDemo.java
Date Fri, 24 Dec 2010 13:11:03 GMT
Author: sabob
Date: Fri Dec 24 13:11:02 2010
New Revision: 1052502

URL: http://svn.apache.org/viewvc?rev=1052502&view=rev
Log:
Remove auto binding from examples CLK-742

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumn.java
    click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java?rev=1052502&r1=1052501&r2=1052502&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/panel/FilterPanelDemo.java
Fri Dec 24 13:11:02 2010
@@ -29,7 +29,6 @@ import org.apache.click.examples.control
 import org.apache.click.examples.domain.Customer;
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.examples.service.CustomerService;
-import org.apache.click.util.Bindable;
 import org.apache.click.dataprovider.DataProvider;
 import org.springframework.stereotype.Component;
 
@@ -41,8 +40,8 @@ public class FilterPanelDemo extends Bor
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected FilterPanel filterPanel = new FilterPanel();
-    @Bindable protected Table table = new Table();
+    private FilterPanel filterPanel = new FilterPanel("filterPanel");
+    private Table table = new Table("table");
 
     @Resource(name="customerService")
     private CustomerService customerService;
@@ -50,6 +49,10 @@ public class FilterPanelDemo extends Bor
     // Constructor ------------------------------------------------------------
 
     public FilterPanelDemo() {
+        // Add components
+        addControl(table);
+        addControl(filterPanel);
+
         // Setup customers table
         table.setClass("isi");
         table.setWidth("550px");

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java?rev=1052502&r1=1052501&r2=1052502&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/panel/ListPanelDemo.java
Fri Dec 24 13:11:02 2010
@@ -27,7 +27,6 @@ import org.apache.click.examples.domain.
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.examples.service.CustomerService;
 import org.apache.click.extras.panel.ListPanel;
-import org.apache.click.util.Bindable;
 import org.springframework.stereotype.Component;
 
 /**
@@ -41,13 +40,13 @@ public class ListPanelDemo extends Borde
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected ListPanel listPanel = new ListPanel();
-    @Bindable protected List<Customer> customers;
+    private ListPanel listPanel = new ListPanel("listPanel");
 
     @Resource(name="customerService")
     private CustomerService customerService;
 
     public ListPanelDemo() {
+        addControl(listPanel);
         listPanel.add(new Panel("panel1", "/panel/customersPanel1.htm"));
         listPanel.add(new Panel("panel2", "/panel/customersPanel2.htm"));
         listPanel.add(new Panel("panel3", "/panel/customersPanel3.htm"));
@@ -58,7 +57,8 @@ public class ListPanelDemo extends Borde
      */
     @Override
     public void onRender() {
-        customers = customerService.getCustomersSortedByName(12);
+        List<Customer> customers = customerService.getCustomersSortedByName(12);
+        addModel("customers", customers);
     }
 
 }

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumn.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumn.java?rev=1052502&r1=1052501&r2=1052502&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumn.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumn.java Fri
Dec 24 13:11:02 2010
@@ -44,6 +44,7 @@ public class PanelColumn extends Column 
     /**
      * @see Column#renderTableDataContent(Object, HtmlStringBuffer, Context, int)
      */
+    @Override
     protected void renderTableDataContent(Object row, HtmlStringBuffer buffer,
         Context context, int rowIndex) {
 

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java?rev=1052502&r1=1052501&r2=1052502&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/panel/PanelColumnDemo.java
Fri Dec 24 13:11:02 2010
@@ -31,6 +31,7 @@ import org.apache.click.examples.domain.
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.examples.service.CustomerService;
 import org.apache.click.util.Bindable;
+import org.apache.click.util.HtmlStringBuffer;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Component;
 
@@ -42,10 +43,11 @@ public class PanelColumnDemo extends Bor
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Panel panel = new Panel("panel", "/panel/customerDetailsPanel.htm");
-    @Bindable protected Form form = new Form();
     @Bindable protected String nameSearch;
-    @Bindable protected Table table = new Table("table");
+
+    private Panel panel = new Panel("panel", "/panel/customerDetailsPanel.htm");
+    private Form form = new Form("form");
+    private Table table;
 
     private TextField textName = new TextField("name", true);
 
@@ -55,7 +57,18 @@ public class PanelColumnDemo extends Bor
     // Constructor ------------------------------------------------------------
 
     public PanelColumnDemo() {
-        form.setMethod("get");
+        addControl(panel);
+        addControl(form);
+
+        table = new Table("table") {
+            @Override
+            protected void renderHeaderRow(HtmlStringBuffer buffer) {
+                // We don't want to render table columns so we override #renderHeaderRow
+                // to do nothing
+            }
+        };
+        addControl(table);
+
         form.add(textName);
         textName.setFocus(true);
         form.add(new Submit("search", " Search ", this, "onSearch"));
@@ -82,11 +95,19 @@ public class PanelColumnDemo extends Bor
         return false;
     }
 
-    /**
-     * @see org.apache.click.Page#onGet()
-     */
+    @Override
+    public void onPost() {
+        handleRequest();
+    }
+
     @Override
     public void onGet() {
+        handleRequest();
+    }
+
+    // Private Methods --------------------------------------------------------
+
+    private void handleRequest() {
         if (StringUtils.isNotEmpty(nameSearch)) {
 
             // Just fill the value so the user can see it
@@ -97,8 +118,6 @@ public class PanelColumnDemo extends Bor
         }
     }
 
-    // Private Methods --------------------------------------------------------
-
     /**
      * Search the Customer by name and create the Table control
      *

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java?rev=1052502&r1=1052501&r2=1052502&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/panel/SimplePanelDemo.java
Fri Dec 24 13:11:02 2010
@@ -20,7 +20,6 @@ package org.apache.click.examples.page.p
 
 import org.apache.click.control.Panel;
 import org.apache.click.examples.page.BorderPage;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides a simple Panel demonstration.
@@ -29,6 +28,9 @@ public class SimplePanelDemo extends Bor
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Panel panel = new Panel("panel", "/panel/simple-panel.htm");
+    private Panel panel = new Panel("panel", "/panel/simple-panel.htm");
 
+    public SimplePanelDemo() {
+        addControl(panel);
+    }
 }



Mime
View raw message