Return-Path: Delivered-To: apmail-click-commits-archive@www.apache.org Received: (qmail 72896 invoked from network); 2 Dec 2010 06:38:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Dec 2010 06:38:44 -0000 Received: (qmail 97771 invoked by uid 500); 2 Dec 2010 06:38:44 -0000 Delivered-To: apmail-click-commits-archive@click.apache.org Received: (qmail 97758 invoked by uid 500); 2 Dec 2010 06:38:43 -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 97749 invoked by uid 99); 2 Dec 2010 06:38:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 06:38:42 +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; Thu, 02 Dec 2010 06:38:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C000C23889E9; Thu, 2 Dec 2010 06:37:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1041288 - /click/trunk/click/examples/src/org/apache/click/examples/page/ajax/form/AdvancedFormAjaxPage.java Date: Thu, 02 Dec 2010 06:37:07 -0000 To: commits@click.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101202063707.C000C23889E9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sabob Date: Thu Dec 2 06:37:07 2010 New Revision: 1041288 URL: http://svn.apache.org/viewvc?rev=1041288&view=rev Log: explicitly register form makes intention clear Modified: click/trunk/click/examples/src/org/apache/click/examples/page/ajax/form/AdvancedFormAjaxPage.java Modified: click/trunk/click/examples/src/org/apache/click/examples/page/ajax/form/AdvancedFormAjaxPage.java URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/ajax/form/AdvancedFormAjaxPage.java?rev=1041288&r1=1041287&r2=1041288&view=diff ============================================================================== --- click/trunk/click/examples/src/org/apache/click/examples/page/ajax/form/AdvancedFormAjaxPage.java (original) +++ click/trunk/click/examples/src/org/apache/click/examples/page/ajax/form/AdvancedFormAjaxPage.java Thu Dec 2 06:37:07 2010 @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.List; import org.apache.click.Control; import org.apache.click.ActionResult; +import org.apache.click.ControlRegistry; import org.apache.click.ajax.DefaultAjaxBehavior; import org.apache.click.control.Form; import org.apache.click.control.Submit; @@ -77,13 +78,15 @@ public class AdvancedFormAjaxPage extend } }); - // NOTE: we add a Behavior to Form so that Click registers the Form as an Ajax target - // ALSO NOTE: we don't implement the onAction method as the save and cancel Submits - // handles the Behavior action event - form.addBehavior(new DefaultAjaxBehavior()); - - // Instead of adding a behavior, the same can be achived by explicitly registering the Form as an Ajax Target: - // ControlRegistry.registerAjaxTarget(form); + // NOTE: we explicitly register the Form as an Ajax target so that the + // Fom#onProcess method can be invoked. The save button's Behavior will + // still handle the request though + ControlRegistry.registerAjaxTarget(form); + + // Instead of explicitly registering the Form, the same can be achived by + // adding an empty Behavior to the Form so that Click register the Form + // as an Ajax target: + // form.addBehavior(new DefaultAjaxBehavior()); } /**