Return-Path: Delivered-To: apmail-click-commits-archive@www.apache.org Received: (qmail 26524 invoked from network); 26 Dec 2010 04:47:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Dec 2010 04:47:08 -0000 Received: (qmail 3855 invoked by uid 500); 26 Dec 2010 04:47:08 -0000 Delivered-To: apmail-click-commits-archive@click.apache.org Received: (qmail 3836 invoked by uid 500); 26 Dec 2010 04:47:07 -0000 Mailing-List: contact commits-help@click.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@click.apache.org Delivered-To: mailing list commits@click.apache.org Received: (qmail 3828 invoked by uid 99); 26 Dec 2010 04:47:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Dec 2010 04:47:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Dec 2010 04:47:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7C7D523889E9; Sun, 26 Dec 2010 04:46:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1052832 - in /click/trunk/click: documentation/xdocs/src/docbook/click/ examples/src/org/apache/click/examples/page/introduction/ Date: Sun, 26 Dec 2010 04:46:46 -0000 To: commits@click.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101226044646.7C7D523889E9@eris.apache.org> Author: sabob Date: Sun Dec 26 04:46:46 2010 New Revision: 1052832 URL: http://svn.apache.org/viewvc?rev=1052832&view=rev Log: Remove auto binding from examples CLK-742 Modified: click/trunk/click/documentation/xdocs/src/docbook/click/chapter-introduction.xml click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType1Page.java click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType2Page.java Modified: click/trunk/click/documentation/xdocs/src/docbook/click/chapter-introduction.xml URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-introduction.xml?rev=1052832&r1=1052831&r2=1052832&view=diff ============================================================================== --- click/trunk/click/documentation/xdocs/src/docbook/click/chapter-introduction.xml (original) +++ click/trunk/click/documentation/xdocs/src/docbook/click/chapter-introduction.xml Sun Dec 26 04:46:46 2010 @@ -160,9 +160,15 @@ public HelloWorld extends Page { public class ControlListenerType1Page extends Page { /* Set the listener to this object's "onLinkClick" method. */ - @Bindable protected ActionLink myLink = new ActionLink(this, "onLinkClick"); + private ActionLink myLink = new ActionLink("myLink", this, "onLinkClick") - @Bindable protected String msg; + private String msg; + + // --------------------------------------------------------- Constructors + + public ControlListenerType1Page() { + addControl(myLink); + } // --------------------------------------------------------- Event Handlers @@ -170,8 +176,9 @@ public HelloWorld extends Page { * Handle the ActionLink control click event. */ public boolean onLinkClick() { - msg = "ControlListenerPage#" + hashCode() + String msg = "ControlListenerPage#" + hashCode() + " object method <tt>onLinkClick()</tt> invoked."; + addModel("msg", msg); return true; } @@ -179,12 +186,10 @@ public HelloWorld extends Page { } - - Variables annotated with @Bindable - is a short-hand way of instructing Click to automatically bind request - parameters to Page variables. In addition these variables will - automatically be added to the Page model. For more information please see the - section Request Parameter Auto Binding. + + Add the link to the page. The link will be made available to the + page template under the variable myLink, which + is the name of the control. @@ -254,10 +259,7 @@ public HelloWorld extends Page { public class ControlListenerType2Page extends Page { - /* Public scope controls are automatically added to the page. */ - @Bindable protected ActionLink myLink = new ActionLink(); - - @Bindable protected String msg; + private ActionLink myLink = new ActionLink("myLink"); // ------------------------------------------------------------ Constructor @@ -265,22 +267,25 @@ public HelloWorld extends Page { * Create a new Page instance. */ public ControlListenerType2Page() { + addControl(myLink); + myLink.setActionListener(new ActionListener() { public boolean onAction(Control control) { - msg = "ControlListenerPage#" + hashCode() + String msg = "ControlListenerPage#" + hashCode() + " object method <tt>onAction()</tt> invoked."; + addModel("msg", msg); return true; } }); } - + } In the Page class we create an ActionLink called myLink. In the Page constructor we set the control's - action listener to an anonymous inner class which implements the - onAction(). When a user clicks on + action listener to an anonymous inner class which implements the method + onAction(). When a user clicks on the myLink control it will invoke the action listener method onAction(). Modified: click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType1Page.java URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType1Page.java?rev=1052832&r1=1052831&r2=1052832&view=diff ============================================================================== --- click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType1Page.java (original) +++ click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType1Page.java Sun Dec 26 04:46:46 2010 @@ -20,7 +20,6 @@ package org.apache.click.examples.page.i import org.apache.click.control.ActionLink; import org.apache.click.examples.page.BorderPage; -import org.apache.click.util.Bindable; /** * Provides a control listener example Page using the runtime binding of the @@ -35,9 +34,13 @@ public class ControlListenerType1Page ex private static final long serialVersionUID = 1L; /* Set the listener to this object's "onLinkClick" method. */ - @Bindable protected ActionLink myLink = new ActionLink(this, "onLinkClick"); + private ActionLink myLink = new ActionLink("myLink", this, "onLinkClick"); - @Bindable protected String msg; + // Constructors ----------------------------------------------------------- + + public ControlListenerType1Page() { + addControl(myLink); + } // Event Handlers --------------------------------------------------------- @@ -45,8 +48,9 @@ public class ControlListenerType1Page ex * Handle the ActionLink control click event. */ public boolean onLinkClick() { - msg = "ControlListenerPage#" + hashCode() + String msg = "ControlListenerPage#" + hashCode() + " object method onLinkClick() invoked."; + addModel("msg", msg); return true; } Modified: click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType2Page.java URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType2Page.java?rev=1052832&r1=1052831&r2=1052832&view=diff ============================================================================== --- click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType2Page.java (original) +++ click/trunk/click/examples/src/org/apache/click/examples/page/introduction/ControlListenerType2Page.java Sun Dec 26 04:46:46 2010 @@ -22,7 +22,6 @@ import org.apache.click.ActionListener; import org.apache.click.Control; import org.apache.click.control.ActionLink; import org.apache.click.examples.page.BorderPage; -import org.apache.click.util.Bindable; /** * Provides a control listener example Page using the compile time binding of @@ -36,9 +35,7 @@ public class ControlListenerType2Page ex private static final long serialVersionUID = 1L; - @Bindable protected ActionLink myLink = new ActionLink(); - - @Bindable protected String msg; + private ActionLink myLink = new ActionLink("myLink"); // Constructor ------------------------------------------------------------ @@ -46,12 +43,15 @@ public class ControlListenerType2Page ex * Create a new Page instance. */ public ControlListenerType2Page() { + addControl(myLink); + myLink.setActionListener(new ActionListener() { private static final long serialVersionUID = 1L; public boolean onAction(Control control) { - msg = "ControlListenerPage#" + hashCode() + String msg = "ControlListenerPage#" + hashCode() + " object method onAction() invoked."; + addModel("msg", msg); return true; }