Return-Path: Delivered-To: apmail-pivot-user-archive@www.apache.org Received: (qmail 98963 invoked from network); 29 Mar 2010 13:06:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Mar 2010 13:06:38 -0000 Received: (qmail 76878 invoked by uid 500); 29 Mar 2010 13:06:38 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 76833 invoked by uid 500); 29 Mar 2010 13:06:38 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 76825 invoked by uid 99); 29 Mar 2010 13:06:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Mar 2010 13:06:37 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tvolkert@gmail.com designates 209.85.210.174 as permitted sender) Received: from [209.85.210.174] (HELO mail-yx0-f174.google.com) (209.85.210.174) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Mar 2010 13:06:30 +0000 Received: by yxe4 with SMTP id 4so5906753yxe.28 for ; Mon, 29 Mar 2010 06:06:09 -0700 (PDT) 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:received:message-id:subject:from:to:content-type; bh=ly+p4k2925Og80E9MR1qkx6GDG1zWV3dk6OOQ+oJdgw=; b=ZV0PDsH2IT438f+2Ty6xLvKyCGBH39AX2fp+YaNr0CFK0a19MpyLEJn/+Hg0hP2f/y xcRCxgXTNPN+Ykz4efFn/AQp8oBjNO2ARAJfCFuxxm7h4KfTkqxSx8ge1zUMZJ8b3AqG W5bklCJSkvrGuYs+YSGiANdigrEz1Ur+8xlRM= 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 :content-type; b=bYy7tHDSo6xR59LjEh8xO/BQMDN3ClfyN5+5e7dZeKyE4gEeLlDsrYE8k/q4rT7UAZ kokcX8dxmkpHGA6ozW9eYJ3miKG5JML1WOnd53QGcB4CZLCm8bE2PncHojtivxKQf+qJ brWLlqPG15cHmmGcB9/FPkAq+RAxt4gmEefV4= MIME-Version: 1.0 Received: by 10.100.10.7 with HTTP; Mon, 29 Mar 2010 06:06:08 -0700 (PDT) In-Reply-To: <49E6FAF1-002F-462E-9F65-ACCB17B8D624@mac.com> References: <20100328203359.A61724@p3c0.erirefr.arg> <49E6FAF1-002F-462E-9F65-ACCB17B8D624@mac.com> Date: Mon, 29 Mar 2010 09:06:08 -0400 Received: by 10.101.106.1 with SMTP id i1mr8283764anm.24.1269867968624; Mon, 29 Mar 2010 06:06:08 -0700 (PDT) Message-ID: <168ef9ac1003290606q44ae916apa983835b20d08c0@mail.gmail.com> Subject: Re: data binding question From: Todd Volkert To: user@pivot.apache.org Content-Type: multipart/alternative; boundary=001636c5bf162e7a960482f02dc4 X-Virus-Checked: Checked by ClamAV on apache.org --001636c5bf162e7a960482f02dc4 Content-Type: text/plain; charset=ISO-8859-1 What he said :-) Michael, I'd add that to your "simple" requierment, WTKX script might be the simplest way to wire up these types of quick event handlers. You'd need your user object class to fire events the Pivot way (using Pivot's ListenerList). Then, your WTKX could look something like this: ... -T On Mon, Mar 29, 2010 at 8:47 AM, Greg Brown wrote: > As you guessed, this type of data binding isn't currently supported. Having > worked with data binding systems like this in the past, I find that it can > lead to confusing and inefficient code, as too many things are happening in > the background when they don't need to be. > > The load()/store() model used by Pivot maps more closely to how data > binding is used in many practical applications (especially those that are > REST-based): after making a server query to retrieve your data, you populate > your form using the load() method. When you want to save it back to the > server, you store() it into your model and upload it back to the server. > > More dynamic updates (like those you describe) can easily be achieved via > event listeners. This way, your application has complete control over what > is updated and when. > > G > > On Mar 28, 2010, at 11:48 PM, Michael Allman wrote: > > > Hello, > > > > I have two related questions on data binding in Pivot. After a lot of > searching and digging, I'm pretty sure the answer is "no" to both of these > questions. I just want to confirm so we can move on to step 2---how to fix > the situation. > > > > So suppose we have some kind of User object with a r/w "name" property > and a Label declared in some WTKX file. My questions are: > > > > 1. Is there a simple way to bind the Label's "text" property to the User > object's "name" property in such a way that as the app user types into the > text field the value of the latter property is set to the value of the > former (label.text => user.name)? > > > > 2. Is there a simple way to bind the User object's "name" property to > the Label's "text" property in such a way that when the value of the former > property is changed, the value of the Label's "text" property is set to the > new value of the User object's "name" property? > > > > This is a very important capability for me, and it's one that I think has > a reasonably simple solution. But I'd like to get a Pivot expert's thoughts > first. Maybe I'm missing something that's already there, or some other > feature that's more powerful than this. > > > > Cheers, > > > > Michael > > --001636c5bf162e7a960482f02dc4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What he said :-)

Michael, I'd add that to your "simple"= ; requierment, WTKX script might be the simplest way to wire up these types= of quick event handlers.=A0 You'd need your user object class to fire = events the Pivot way (using Pivot's ListenerList).=A0 Then, your WTKX c= ould look something like this:

<myPackage:UserData wtkx:id=3D"userData" UserDataListener.= fooChanged=3D"textInput.setText(userData.getFoo())"/>
...<TextInput wtkx:id=3D"textInput" TextInputTextListener.textC= hanged=3D"userData.setFoo(textInput.getText())"/>

-T

On Mon, Mar 29, 2010 at 8:47 AM, G= reg Brown <gkbrown@= mac.com> wrote:
As you guessed, this type of data binding isn't currently supported. Ha= ving worked with data binding systems like this in the past, I find that it= can lead to confusing and inefficient code, as too many things are happeni= ng in the background when they don't need to be.

The load()/store() model used by Pivot maps more closely to how data bindin= g is used in many practical applications (especially those that are REST-ba= sed): after making a server query to retrieve your data, you populate your = form using the load() method. When you want to save it back to the server, = you store() it into your model and upload it back to the server.

More dynamic updates (like those you describe) can easily be achieved via e= vent listeners. This way, your application has complete control over what i= s updated and when.

G

On Mar 28, 2010, at 11:48 PM, Michael Allman wrote:

> Hello,
>
> I have two related questions on data binding in Pivot. =A0After a lot = of searching and digging, I'm pretty sure the answer is "no" = to both of these questions. =A0I just want to confirm so we can move on to = step 2---how to fix the situation.
>
> So suppose we have some kind of User object with a r/w "name"= ; property and a Label declared in some WTKX file. =A0My questions are:
>
> 1. =A0Is there a simple way to bind the Label's "text" p= roperty to the User object's "name" property in such a way th= at as the app user types into the text field the value of the latter proper= ty is set to the value of the former (label.text =3D> user.name)?
>
> 2. =A0Is there a simple way to bind the User object's "name&q= uot; property to the Label's "text" property in such a way th= at when the value of the former property is changed, the value of the Label= 's "text" property is set to the new value of the User object= 's "name" property?
>
> This is a very important capability for me, and it's one that I th= ink has a reasonably simple solution. =A0But I'd like to get a Pivot ex= pert's thoughts first. =A0Maybe I'm missing something that's al= ready there, or some other feature that's more powerful than this.
>
> Cheers,
>
> Michael


--001636c5bf162e7a960482f02dc4--