Return-Path: Delivered-To: apmail-incubator-click-dev-archive@minotaur.apache.org Received: (qmail 73664 invoked from network); 18 Jan 2010 12:23:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jan 2010 12:23:58 -0000 Received: (qmail 17087 invoked by uid 500); 18 Jan 2010 12:23:58 -0000 Delivered-To: apmail-incubator-click-dev-archive@incubator.apache.org Received: (qmail 17050 invoked by uid 500); 18 Jan 2010 12:23:58 -0000 Mailing-List: contact click-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@incubator.apache.org Delivered-To: mailing list click-dev@incubator.apache.org Received: (qmail 17034 invoked by uid 99); 18 Jan 2010 12:23:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jan 2010 12:23:58 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of malcolm.edgar@gmail.com designates 209.85.223.196 as permitted sender) Received: from [209.85.223.196] (HELO mail-iw0-f196.google.com) (209.85.223.196) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jan 2010 12:23:50 +0000 Received: by iwn34 with SMTP id 34so1966922iwn.21 for ; Mon, 18 Jan 2010 04:23:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=coWZd5ElPyQ4UWdx60RV9vXfcMVecx6chPuGqsoLWDk=; b=R+IybmjQmloP7uOSSw0Jyaz8Riu4iaQjZ7MEAa2NCH4buodpZch1s4KTZsbT1TYNg7 EpilbpSU6m5C6U3Hgq4f/jIp1wcNCr1bwcNAGKAkBmTTll9qp3BQwiqbzlxWhyYWV8NS 5NDdfafrpyUlT7NL0oEI/hHHTrTjuDzYBCI/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=h/jucp/4YY8kTi34i60wlssLBx5zIR6ldnp18hhieun+8pKjNpQz6yhB7X/FWgKLcJ cAtOlg8avlZugVt/Vegq7ZXQcOtnwH5U0FbpwXtt882hNJqy+jdCZzCZ7bd3QjAQHsWu x7h/3chdmDGolEGgOaUrXS1PzQCGuILA8BktM= MIME-Version: 1.0 Received: by 10.231.169.71 with SMTP id x7mr2700057iby.18.1263817409514; Mon, 18 Jan 2010 04:23:29 -0800 (PST) In-Reply-To: <4B541D04.6040808@gmail.com> References: <4B541D04.6040808@gmail.com> Date: Mon, 18 Jan 2010 23:23:29 +1100 Message-ID: <525d8e11001180423j1436c819waf4b88d306638c21@mail.gmail.com> Subject: Re: On demand binding From: Malcolm Edgar To: click-dev Cc: click-user Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org +1 I think this is a good idea, so long as the fields parent form submit status is respected, i.e. if a page has two forms only fields belonging to the submitted form should be able to bind their fields. regards Malcolm Edgar On Mon, Jan 18, 2010 at 7:34 PM, Bob Schellink wrote: > Hi all, > > Thought I'd solicit some feedback on a new feature I've been pondering ab= out > the last couple of days. > > Enter On Demand Binding, the ability for a field to bind to its request > parameter when needed! > > Controls are bound to incoming request parameters during the onProcess > phase. However often times we need to know a control's value during the > onInit phase, so we can perform conditional logic such as adding new fiel= ds > to a form. > > Currently we can either bind a field value explicitly using the method > #bindRequestValue, or inspect the HttpRequest parameters: > > public void onInit() { > > =A0Checkbox chk =3D new Checkbox("chk"); > =A0chk.bindRequestValue(); =A0// Without On Demand Binding, we need to bi= nd > explicitly > > =A0if (chk.isChecked()) { > =A0 =A0form.add(new TextField("comment")); > =A0} > } > > The idea with On Demand Binding is that Fields should bind to its incomin= g > request parameter when needed. For example: > > public void onInit() { > > =A0Checkbox chk =3D new Checkbox("chk"); > > =A0if (chk.isChecked()) { > =A0 =A0form.add(new TextField("comment")); > =A0} > } > > > What do you think? Will this feature be useful or cause unnecessary > confusion? > > kind regards > > bob >