click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1052756 - in /click/trunk/click/examples/src/org/apache/click/examples/page: jsp/CustomerTable.java jsp/EditCustomerPage.java jsp/HelloWorld.java jsp/MultiPathDemo.java jsp/NavigationA.java pageflow/StartPage.java
Date Sat, 25 Dec 2010 07:52:03 GMT
Author: sabob
Date: Sat Dec 25 07:52:03 2010
New Revision: 1052756

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

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/jsp/CustomerTable.java
    click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java
    click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java
    click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java
    click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/jsp/CustomerTable.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/CustomerTable.java?rev=1052756&r1=1052755&r2=1052756&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/jsp/CustomerTable.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/jsp/CustomerTable.java Sat
Dec 25 07:52:03 2010
@@ -25,7 +25,6 @@ import javax.annotation.Resource;
 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.springframework.stereotype.Component;
 
 /**
@@ -37,8 +36,6 @@ public class CustomerTable extends Borde
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected List<Customer> customers = null;
-
     @Resource(name="customerService")
     private CustomerService customerService;
 
@@ -49,7 +46,8 @@ public class CustomerTable extends Borde
      */
     @Override
     public void onRender() {
-        customers = customerService.getCustomersSortedByName(10);
+        List<Customer> customers = customerService.getCustomersSortedByName(10);
+        addModel("customers", customers);
     }
 
     // Public Methods ---------------------------------------------------------

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java?rev=1052756&r1=1052755&r2=1052756&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/jsp/EditCustomerPage.java
Sat Dec 25 07:52:03 2010
@@ -26,7 +26,6 @@ import org.apache.click.examples.page.Bo
 import org.apache.click.extras.control.DateField;
 import org.apache.click.extras.control.DoubleField;
 import org.apache.click.extras.control.EmailField;
-import org.apache.click.util.Bindable;
 
 /**
  * Demo a form submit using JSP as template.
@@ -35,11 +34,13 @@ public class EditCustomerPage extends Bo
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Form form = new Form("form");
+    private Form form = new Form("form");
 
     // Constructor ------------------------------------------------------------
 
     public EditCustomerPage() {
+        addControl(form);
+
         // Setup customers form
         FieldSet fieldSet = new FieldSet("customer");
         fieldSet.add(new TextField("name", true));

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java?rev=1052756&r1=1052755&r2=1052756&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/jsp/HelloWorld.java Sat
Dec 25 07:52:03 2010
@@ -21,19 +21,16 @@ package org.apache.click.examples.page.j
 import java.util.Date;
 
 import org.apache.click.Page;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides HelloWorld world example Page. Possibly the simplest dynamic example
  * you can get.
- * <p/>
- * Note the public scope time Date field is automatically added to the page's
- * model as a value named "time".
  */
 public class HelloWorld extends Page {
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Date time = new Date();
-
+    public HelloWorld() {
+        addModel("time", new Date());
+    }
 }

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java?rev=1052756&r1=1052755&r2=1052756&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/jsp/MultiPathDemo.java Sat
Dec 25 07:52:03 2010
@@ -21,7 +21,6 @@ package org.apache.click.examples.page.j
 import org.apache.click.control.ActionLink;
 import org.apache.click.control.PageLink;
 import org.apache.click.examples.page.BorderPage;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides a multiple JSP page path example class.
@@ -30,9 +29,14 @@ public class MultiPathDemo extends Borde
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected ActionLink changePath = new ActionLink("changePath", this, "changePath");
+    private ActionLink changePath = new ActionLink("changePath", this, "changePath");
 
-    @Bindable protected PageLink defaultPath = new PageLink("defaultPath", MultiPathDemo.class);
+    private PageLink defaultPath = new PageLink("defaultPath", MultiPathDemo.class);
+
+    public MultiPathDemo() {
+        addControl(changePath);
+        addControl(defaultPath);
+    }
 
     public boolean changePath() {
         setPath("/jsp/dummy.jsp");

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java?rev=1052756&r1=1052755&r2=1052756&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/jsp/NavigationA.java Sat
Dec 25 07:52:03 2010
@@ -20,7 +20,6 @@ package org.apache.click.examples.page.j
 
 import org.apache.click.control.ActionLink;
 import org.apache.click.examples.page.BorderPage;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides an navigation example Page demonstrating forward and redirect
@@ -30,10 +29,10 @@ public class NavigationA extends BorderP
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected ActionLink forwardLink = new ActionLink("forwardLink", this, "onForwardClick");
-    @Bindable protected ActionLink forwardParamLink = new ActionLink("forwardParamLink",
this, "onForwardParamClick");
-    @Bindable protected ActionLink redirectLink = new ActionLink("redirectLink", this, "onRedirectClick");
-    @Bindable protected ActionLink redirectParamLink = new ActionLink("redirectParamLink",
this, "onRedirectParamClick");
+    private ActionLink forwardLink = new ActionLink("forwardLink", this, "onForwardClick");
+    private ActionLink forwardParamLink = new ActionLink("forwardParamLink", this, "onForwardParamClick");
+    private ActionLink redirectLink = new ActionLink("redirectLink", this, "onRedirectClick");
+    private ActionLink redirectParamLink = new ActionLink("redirectParamLink", this, "onRedirectParamClick");
 
     // Event Handlers ---------------------------------------------------------
 
@@ -44,6 +43,11 @@ public class NavigationA extends BorderP
     public void onInit() {
         super.onInit();
 
+        addControl(forwardLink);
+        addControl(forwardParamLink);
+        addControl(redirectLink);
+        addControl(redirectParamLink);
+
         // Initialise param ActionLink values from any parameters passed through
         // from other pages via forwards or redirects.
         Integer number = new Integer(1);

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java?rev=1052756&r1=1052755&r2=1052756&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/pageflow/StartPage.java
Sat Dec 25 07:52:03 2010
@@ -43,7 +43,6 @@ import org.apache.click.examples.page.Bo
 import org.apache.click.examples.page.HomePage;
 import org.apache.click.examples.service.CustomerService;
 import org.apache.click.extras.control.DateField;
-import org.apache.click.util.Bindable;
 import org.apache.click.util.ClickUtils;
 import org.springframework.stereotype.Component;
 
@@ -55,7 +54,7 @@ public class StartPage extends BorderPag
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Form form = new Form();
+    private Form form = new Form("form");
 
     private Select customerSelect;
     private DateField dateField;
@@ -70,6 +69,7 @@ public class StartPage extends BorderPag
     // Constructor ------------------------------------------------------------
 
     public StartPage() {
+        addControl(form);
         form.setLabelsPosition("top");
 
         customerSelect = new Select("Customer");



Mime
View raw message