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/24 09:09:55 UTC
svn commit: r1052460 - in
/click/trunk/click/examples/src/org/apache/click/examples/page/table:
EditTable.java FormTablePage.java LargeDatasetDemo.java
SearchTablePage.java TableDecorator.java
Author: sabob
Date: Fri Dec 24 08:09:55 2010
New Revision: 1052460
URL: http://svn.apache.org/viewvc?rev=1052460&view=rev
Log:
Remove auto binding from examples CLK-742
Modified:
click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java
click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java
click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java
click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java
click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java?rev=1052460&r1=1052459&r2=1052460&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/table/EditTable.java Fri Dec 24 08:09:55 2010
@@ -38,7 +38,6 @@ import org.apache.click.extras.control.D
import org.apache.click.extras.control.DoubleField;
import org.apache.click.extras.control.EmailField;
import org.apache.click.extras.control.LinkDecorator;
-import org.apache.click.util.Bindable;
import org.apache.click.dataprovider.DataProvider;
import org.springframework.stereotype.Component;
@@ -51,10 +50,10 @@ public class EditTable extends BorderPag
private static final long serialVersionUID = 1L;
- @Bindable protected CayenneForm form = new CayenneForm("form", Customer.class);
- @Bindable protected Table table = new Table();
- @Bindable protected ActionLink editLink = new ActionLink("edit", "Edit", this, "onEditClick");
- @Bindable protected ActionLink deleteLink = new ActionLink("delete", "Delete", this, "onDeleteClick");
+ private CayenneForm form = new CayenneForm("form", Customer.class);
+ private Table table = new Table("table");
+ private ActionLink editLink = new ActionLink("edit", "Edit", this, "onEditClick");
+ private ActionLink deleteLink = new ActionLink("delete", "Delete", this, "onDeleteClick");
@Resource(name="customerService")
private CustomerService customerService;
@@ -62,6 +61,11 @@ public class EditTable extends BorderPag
// Constructor ------------------------------------------------------------
public EditTable() {
+ addControl(form);
+ addControl(table);
+ addControl(editLink);
+ addControl(deleteLink);
+
// Setup customers form
FieldSet fieldSet = new FieldSet("customer");
fieldSet.add(new TextField("name"));
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java?rev=1052460&r1=1052459&r2=1052460&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/table/FormTablePage.java Fri Dec 24 08:09:55 2010
@@ -38,7 +38,6 @@ import org.apache.click.extras.control.E
import org.apache.click.extras.control.FieldColumn;
import org.apache.click.extras.control.FormTable;
import org.apache.click.extras.control.NumberField;
-import org.apache.click.util.Bindable;
import org.apache.click.dataprovider.DataProvider;
import org.springframework.stereotype.Component;
@@ -52,7 +51,7 @@ public class FormTablePage extends Borde
private static final int NUM_ROWS = 20;
- @Bindable protected FormTable table = new FormTable();
+ private FormTable table = new FormTable("table");
@Resource(name="customerService")
private CustomerService customerService;
@@ -60,6 +59,8 @@ public class FormTablePage extends Borde
// Constructor ------------------------------------------------------------
public FormTablePage() {
+ addControl(table);
+
// Setup customers table
table.setClass(Table.CLASS_SIMPLE);
table.setWidth("700px");
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java?rev=1052460&r1=1052459&r2=1052460&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/table/LargeDatasetDemo.java Fri Dec 24 08:09:55 2010
@@ -27,7 +27,6 @@ import org.apache.click.control.Table;
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.PagingDataProvider;
import org.springframework.stereotype.Component;
@@ -40,7 +39,7 @@ public class LargeDatasetDemo extends Bo
private static final long serialVersionUID = 1L;
- @Bindable protected Table table;
+ private Table table = new Table("table");
@Resource(name="customerService")
private CustomerService customerService;
@@ -48,7 +47,8 @@ public class LargeDatasetDemo extends Bo
// Constructor ------------------------------------------------------------
public LargeDatasetDemo() {
- table = new Table();
+ // Add table to page
+ addControl(table);
// Setup customers table
table.setClass(Table.CLASS_ITS);
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java?rev=1052460&r1=1052459&r2=1052460&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/table/SearchTablePage.java Fri Dec 24 08:09:55 2010
@@ -39,7 +39,6 @@ import org.apache.click.examples.service
import org.apache.click.extras.control.DateField;
import org.apache.click.extras.control.LinkDecorator;
import org.apache.click.extras.control.TableInlinePaginator;
-import org.apache.click.util.Bindable;
import org.apache.click.dataprovider.DataProvider;
/**
@@ -49,10 +48,10 @@ public class SearchTablePage extends Bor
private static final long serialVersionUID = 1L;
- @Bindable protected Form form = new Form();
- @Bindable protected Table table = new Table();
- @Bindable protected PageLink editLink = new PageLink("Edit", EditCustomer.class);
- @Bindable protected ActionLink deleteLink = new ActionLink("Delete", this, "onDeleteClick");
+ private Form form = new Form("form");
+ private Table table = new Table("table");
+ private PageLink editLink = new PageLink("Edit", EditCustomer.class);
+ private ActionLink deleteLink = new ActionLink("Delete", this, "onDeleteClick");
private TextField nameField = new TextField(Customer.NAME_PROPERTY);
private DateField dateField = new DateField(Customer.DATE_JOINED_PROPERTY, "Start Date");
@@ -67,6 +66,11 @@ public class SearchTablePage extends Bor
// Constructor ------------------------------------------------------------
public SearchTablePage() {
+ addControl(form);
+ addControl(table);
+ addControl(editLink);
+ addControl(deleteLink);
+
// Setup the search form
form.setColumns(2);
form.add(nameField);
Modified: click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java?rev=1052460&r1=1052459&r2=1052460&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/table/TableDecorator.java Fri Dec 24 08:09:55 2010
@@ -32,7 +32,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.apache.click.dataprovider.DataProvider;
import org.springframework.stereotype.Component;
@@ -44,12 +43,11 @@ public class TableDecorator extends Bord
private static final long serialVersionUID = 1L;
- @Bindable protected Table table = new Table();
- @Bindable protected Customer customerDetail;
+ private Table table = new Table("table");
- @Bindable protected ActionLink viewLink = new ActionLink("view", this, "onViewClick");
- @Bindable protected PageLink editLink = new PageLink("edit", EditCustomer.class);
- @Bindable protected ActionLink deleteLink = new ActionLink("delete", this, "onDeleteClick");
+ private ActionLink viewLink = new ActionLink("view", this, "onViewClick");
+ private PageLink editLink = new PageLink("edit", EditCustomer.class);
+ private ActionLink deleteLink = new ActionLink("delete", this, "onDeleteClick");
@Resource(name="customerService")
private CustomerService customerService;
@@ -57,6 +55,12 @@ public class TableDecorator extends Bord
// Constructor ------------------------------------------------------------
public TableDecorator() {
+ // Add controls to page
+ addControl(table);
+ addControl(viewLink);
+ addControl(editLink);
+ addControl(deleteLink);
+
// Setup customers table
table.setClass(Table.CLASS_SIMPLE);
@@ -118,7 +122,8 @@ public class TableDecorator extends Bord
public boolean onViewClick() {
Integer id = viewLink.getValueInteger();
- customerDetail = customerService.getCustomerForID(id);
+ Customer customerDetail = customerService.getCustomerForID(id);
+ addModel("customerDetail", customerDetail);
return true;
}