click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1052769 - in /click/trunk/click/examples/src/org/apache/click/examples/page/control: LinkDemo.java PickListDemo.java RegexDemo.java SelectDemo.java SubmitLinkDemo.java
Date Sat, 25 Dec 2010 11:33:33 GMT
Author: sabob
Date: Sat Dec 25 11:33:32 2010
New Revision: 1052769

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

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/control/LinkDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/control/PickListDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/control/RegexDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/control/SelectDemo.java
    click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/control/LinkDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/control/LinkDemo.java?rev=1052769&r1=1052768&r2=1052769&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/control/LinkDemo.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/control/LinkDemo.java Sat
Dec 25 11:33:32 2010
@@ -26,7 +26,6 @@ import org.apache.click.examples.page.Bo
 import org.apache.click.examples.page.HomePage;
 import org.apache.click.extras.control.ExternalLink;
 import org.apache.click.extras.control.PageButton;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides an ActionLink, ExternalLink and PageLink control examples Page.
@@ -35,26 +34,37 @@ public class LinkDemo extends BorderPage
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected ActionLink actionLink = new ActionLink("ActionLink", this, "onLinkClick");
-    @Bindable protected ActionLink disabledActionLink = new ActionLink("DisabledActionLink",
this, "onLinkClick");
-    @Bindable protected ActionLink iconActionLink = new ActionLink("IconActionLink", this,
"onLinkClick");
-    @Bindable protected ActionLink disabledIconActionLink = new ActionLink("DisabledIconActionLink",
this, "onLinkClick");
-
-    @Bindable protected PageLink pageLink = new PageLink("PageLink", HomePage.class);
-    @Bindable protected PageLink disabledPageLink = new PageLink("DisabledPageLink", HomePage.class);
-    @Bindable protected PageLink iconPageLink = new PageLink("IconPageLink",HomePage.class);
-    @Bindable protected PageLink disabledIconPageLink = new PageLink("DisabledIconPageLink",HomePage.class);
-
-    @Bindable protected PageButton pageButton = new PageButton("PageButton", HomePage.class);
-    @Bindable protected PageButton disabledPageButton = new PageButton("DisabledPageButton",
HomePage.class);
-    @Bindable protected ExternalLink externalLink = new ExternalLink("ExternalLink", "http://www.google.com/search");
-    @Bindable protected ExternalLink disabledExternalLink = new ExternalLink("DisabledExternalLink",
"http://www.google.com/search");
-
-    @Bindable protected String clicked;
+    private ActionLink actionLink = new ActionLink("ActionLink", this, "onLinkClick");
+    private ActionLink disabledActionLink = new ActionLink("DisabledActionLink", this, "onLinkClick");
+    private ActionLink iconActionLink = new ActionLink("IconActionLink", this, "onLinkClick");
+    private ActionLink disabledIconActionLink = new ActionLink("DisabledIconActionLink",
this, "onLinkClick");
+
+    private PageLink pageLink = new PageLink("PageLink", HomePage.class);
+    private PageLink disabledPageLink = new PageLink("DisabledPageLink", HomePage.class);
+    private PageLink iconPageLink = new PageLink("IconPageLink",HomePage.class);
+    private PageLink disabledIconPageLink = new PageLink("DisabledIconPageLink",HomePage.class);
+
+    private PageButton pageButton = new PageButton("PageButton", HomePage.class);
+    private PageButton disabledPageButton = new PageButton("DisabledPageButton", HomePage.class);
+    private ExternalLink externalLink = new ExternalLink("ExternalLink", "http://www.google.com/search");
+    private ExternalLink disabledExternalLink = new ExternalLink("DisabledExternalLink",
"http://www.google.com/search");
 
     // Constructor ------------------------------------------------------------
 
     public LinkDemo() {
+        addControl(actionLink);
+        addControl(disabledActionLink);
+        addControl(iconActionLink);
+        addControl(disabledIconActionLink);
+        addControl(pageLink);
+        addControl(disabledPageLink);
+        addControl(iconPageLink);
+        addControl(disabledIconPageLink);
+        addControl(pageButton);
+        addControl(disabledPageButton);
+        addControl(externalLink);
+        addControl(disabledExternalLink);
+
         iconActionLink.setRenderLabelAndImage(true);
         iconActionLink.addStyleClass("image-link");
         iconActionLink.setImageSrc("/assets/images/table-edit.png");
@@ -90,7 +100,8 @@ public class LinkDemo extends BorderPage
     // Event Handlers ---------------------------------------------------------
 
     public boolean onLinkClick() {
-        clicked = getClass().getName() + ".onLinkClick invoked at " + (new Date());
+        String msg = getClass().getName() + ".onLinkClick invoked at " + (new Date());
+        addModel("msg", msg);
         return true;
     }
 

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/control/PickListDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/control/PickListDemo.java?rev=1052769&r1=1052768&r2=1052769&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/control/PickListDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/control/PickListDemo.java
Sat Dec 25 11:33:32 2010
@@ -25,7 +25,6 @@ import org.apache.click.control.Option;
 import org.apache.click.control.Submit;
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.extras.control.PickList;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides an Select example Page.
@@ -34,14 +33,15 @@ public class PickListDemo extends Border
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Form form = new Form();
-    @Bindable protected List selectedValues;
+    private Form form = new Form("form");
 
     private PickList pickList = new PickList("languages");
 
     // Constructor ------------------------------------------------------------
 
     public PickListDemo() {
+        addControl(form);
+
         pickList.setHeaderLabel("Languages", "Selected");
 
         pickList.add(new Option("002", "C/C++"));
@@ -63,7 +63,8 @@ public class PickListDemo extends Border
     // Event Handlers ---------------------------------------------------------
 
     public boolean onOkClick() {
-        selectedValues = pickList.getSelectedValues();
+        List selectedValues = pickList.getSelectedValues();
+        addModel("selectedValues", selectedValues);
         return true;
     }
 

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/control/RegexDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/control/RegexDemo.java?rev=1052769&r1=1052768&r2=1052769&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/control/RegexDemo.java (original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/control/RegexDemo.java Sat
Dec 25 11:33:32 2010
@@ -24,7 +24,6 @@ import org.apache.click.examples.page.Bo
 import org.apache.click.examples.page.HomePage;
 import org.apache.click.extras.control.PageSubmit;
 import org.apache.click.extras.control.RegexField;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides a form RegexField example.
@@ -33,9 +32,11 @@ public class RegexDemo extends BorderPag
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Form form = new Form();
+    private Form form = new Form("form");
 
     public RegexDemo() {
+        addControl(form);
+
         RegexField versionField = new RegexField("version", "Version", 10);
         versionField.setPattern("[0-9]+\\.[0-9]+\\.[0-9]+");
         versionField.setRequired(true);

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/control/SelectDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/control/SelectDemo.java?rev=1052769&r1=1052768&r2=1052769&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/control/SelectDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/control/SelectDemo.java
Sat Dec 25 11:33:32 2010
@@ -31,7 +31,6 @@ import org.apache.click.examples.page.Bo
 import org.apache.click.examples.page.HomePage;
 import org.apache.click.extras.control.CountrySelect;
 import org.apache.click.extras.control.PageSubmit;
-import org.apache.click.util.Bindable;
 
 /**
  * Provides an Select example Page.
@@ -40,7 +39,7 @@ public class SelectDemo extends BorderPa
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected Form form = new Form();
+    private Form form = new Form("form");
 
     private Select genderSelect;
     private Select investmentSelect;
@@ -51,6 +50,7 @@ public class SelectDemo extends BorderPa
 
     @SuppressWarnings("unchecked")
     public SelectDemo() {
+        addControl(form);
         form.setErrorsPosition(Form.POSITION_TOP);
 
         // Gender Select - populated through a DataProvider

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java?rev=1052769&r1=1052768&r2=1052769&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/control/SubmitLinkDemo.java
Sat Dec 25 11:33:32 2010
@@ -27,7 +27,6 @@ import org.apache.click.control.Form;
 import org.apache.click.control.TextField;
 import org.apache.click.examples.page.BorderPage;
 import org.apache.click.extras.control.SubmitLink;
-import org.apache.click.util.Bindable;
 
 /**
  * This example demonstrates how to use a SubmitLink control together with the
@@ -37,14 +36,6 @@ public class SubmitLinkDemo extends Bord
 
     private static final long serialVersionUID = 1L;
 
-    @Bindable protected String demo1Msg;
-
-    @Bindable protected String demo2Msg;
-
-    @Bindable protected String demo3Msg;
-
-    @Bindable protected String demo4Msg;
-
     // Constructor ------------------------------------------------------------
 
     public SubmitLinkDemo() {
@@ -78,8 +69,9 @@ public class SubmitLinkDemo extends Bord
         submitLink.setActionListener(new ActionListener() {
 
             public boolean onAction(Control source) {
-                demo1Msg = submitLink.getName() + ".onAction invoked at "
+                String demo1Msg = submitLink.getName() + ".onAction invoked at "
                     + (new Date());
+                addModel("demo1Msg", demo1Msg);
                 return true;
             }
         });
@@ -108,9 +100,10 @@ public class SubmitLinkDemo extends Bord
         paramLink.setActionListener(new ActionListener() {
 
             public boolean onAction(Control source) {
-                demo2Msg = paramLink.getName() + ".onAction invoked at "
+                String demo2Msg = paramLink.getName() + ".onAction invoked at "
                     + (new Date());
                 demo2Msg += "<br>Parameters:" + paramLink.getParameters();
+                addModel("demo2Msg", demo2Msg);
                 return true;
             }
         });
@@ -127,8 +120,9 @@ public class SubmitLinkDemo extends Bord
         standaloneLink.setActionListener(new ActionListener() {
 
             public boolean onAction(Control source) {
-                demo3Msg = source.getName() + ".onAction invoked at " +
+                String demo3Msg = source.getName() + ".onAction invoked at " +
                     (new Date());
+                addModel("demo3Msg", demo3Msg);
                 return true;
             }
         });
@@ -158,8 +152,9 @@ public class SubmitLinkDemo extends Bord
         confirmationLink.setActionListener(new ActionListener() {
 
             public boolean onAction(Control source) {
-                demo4Msg = confirmationLink.getName() + ".onAction invoked at "
+                String demo4Msg = confirmationLink.getName() + ".onAction invoked at "
                     + (new Date());
+                addModel("demo4Msg", demo4Msg);
                 return true;
             }
         });



Mime
View raw message