You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2010/12/23 13:20:38 UTC

svn commit: r1052238 - in /click/trunk/click/examples/src/org/apache/click/examples/page/velocity: ActionTable.java VelocityMacro.java

Author: sabob
Date: Thu Dec 23 12:20:38 2010
New Revision: 1052238

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

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java
    click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java?rev=1052238&r1=1052237&r2=1052238&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/velocity/ActionTable.java Thu Dec 23 12:20:38 2010
@@ -29,7 +29,6 @@ import org.apache.click.examples.domain.
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.examples.page.EditCustomer;
 import org.apache.click.examples.service.CustomerService;
-import org.apache.click.util.Bindable;
 import org.springframework.stereotype.Component;
 
 /**
@@ -44,11 +43,9 @@ public class ActionTable extends BorderP
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected List<Customer> customers;
-    @Bindable protected Customer customerDetail;
-    @Bindable protected ActionLink viewLink = new ActionLink(this, "onViewClick");
-    @Bindable protected PageLink editLink = new PageLink(EditCustomer.class);
-    @Bindable protected ActionLink deleteLink = new ActionLink(this, "onDeleteClick");
+    private  ActionLink viewLink = new ActionLink("viewLink", this, "onViewClick");
+    private  PageLink editLink = new PageLink("editLink", EditCustomer.class);
+    private  ActionLink deleteLink = new ActionLink("deleteLink", this, "onDeleteClick");
 
     @Resource(name="customerService")
     private CustomerService customerService;
@@ -57,13 +54,18 @@ public class ActionTable extends BorderP
     public void onInit() {
         super.onInit();
 
-        String path = getContext().getPagePath(getClass());
-        editLink.setParameter("referrer", path);
+        addControl(viewLink);
+        addControl(editLink);
+        addControl(deleteLink);
+
+        String pagePath = getContext().getPagePath(getClass());
+        editLink.setParameter("referrer", pagePath);
     }
 
     public boolean onViewClick() {
         Integer id = viewLink.getValueInteger();
-        customerDetail = customerService.getCustomerForID(id);
+        Customer customerDetail = customerService.getCustomerForID(id);
+        addModel("customerDetail", customerDetail);
 
         return true;
     }
@@ -83,7 +85,8 @@ public class ActionTable extends BorderP
      */
     @Override
     public void onRender() {
-        customers = customerService.getCustomersSortedByName(7);
+        List<Customer> customers = customerService.getCustomersSortedByName(7);
+        addModel("customers", customers);
         getFormat().setEmptyString("&nbsp;");
     }
 

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java?rev=1052238&r1=1052237&r2=1052238&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/velocity/VelocityMacro.java Thu Dec 23 12:20:38 2010
@@ -29,7 +29,6 @@ import org.apache.click.extras.control.D
 import org.apache.click.extras.control.EmailField;
 import org.apache.click.extras.control.IntegerField;
 import org.apache.click.extras.control.PageSubmit;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides a Velocity Macro example.
@@ -38,9 +37,10 @@ public class VelocityMacro extends Borde
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Form form = new Form();
+    private Form form = new Form("form");
 
     public VelocityMacro() {
+        addControl(form);
         TextField nameField = new TextField("name", true);
         nameField.setMinLength(5);
         nameField.setTitle("Customer full name");