Return-Path: Delivered-To: apmail-pivot-user-archive@www.apache.org Received: (qmail 49833 invoked from network); 21 Oct 2010 19:47:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Oct 2010 19:47:57 -0000 Received: (qmail 4538 invoked by uid 500); 21 Oct 2010 19:47:56 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 4521 invoked by uid 500); 21 Oct 2010 19:47:56 -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 4513 invoked by uid 99); 21 Oct 2010 19:47:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 19:47:56 +0000 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of gkbrown@mac.com does not designate 206.46.173.3 as permitted sender) Received: from [206.46.173.3] (HELO vms173003pub.verizon.net) (206.46.173.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Oct 2010 19:47:47 +0000 Received: from [192.168.1.11] ([unknown] [98.110.173.176]) by vms173003.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LAN00DBJO7VVUH0@vms173003.mailsrvcs.net> for user@pivot.apache.org; Thu, 21 Oct 2010 14:47:13 -0500 (CDT) From: Greg Brown MIME-version: 1.0 (Apple Message framework v1081) Content-type: multipart/alternative; boundary=Apple-Mail-14-145587034 Subject: Re: Noobie question about data binding... Date: Thu, 21 Oct 2010 15:47:12 -0400 In-reply-to: To: user@pivot.apache.org References: <37D0C85C-EE4F-4988-B72D-79942E32AF9F@mac.com> <43777963-EFFA-4637-A66C-A82381703D51@mac.com> <1287605910677-1741488.post@n3.nabble.com> <93D853FC-9C6D-4042-AAAB-51E3ACBC6702@mac.com> Message-id: <35D225D9-D06B-42D0-8787-9B025F6D1645@mac.com> X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-14-145587034 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Glad to hear that you got it working. :-) On Oct 21, 2010, at 3:40 PM, Gerrick Bivins wrote: > Hi Greg, > I got this to work. The main issue was I wasn't setting things up in = the bxml properly. Here is what I ended up doing: > 1) define the list in bxml (as you suggested): > > > > 2) Then in my java code, I have: > class SomeWindowWithTable extends Window implements Bindable > { > ... > @BXML private List tableDataInList; > ... > } >=20 > 3) Any time I want to modify the view in the table: > in java: > this.tableDataInList.clear(); //clears the table > in script: > =20 > > > function buttonPressed(button) { > tableDataInList.clear(); > } > >=20 > > I was confused about what was needed to be defined and where. >=20 > Works like a champ now! > Thanks for the patience! > Gerrick > On Thu, Oct 21, 2010 at 11:59 AM, Greg Brown wrote: > Can you try running the attached example and let me know what happens = when you click the button? Easiest way to launch it is via the Eclipse = plugin, which you can get here: >=20 > = http://cwiki.apache.org/confluence/download/attachments/108483/org.apache.= pivot.eclipse_2.0.0.jar >=20 > If you don't use Eclipse you can launch it via ScriptApplication = directly. Let me know if you need any help with that. >=20 > G >=20 >=20 >=20 > On Oct 21, 2010, at 11:01 AM, Gerrick Bivins wrote: >=20 >> Hi Greg,lello, >>=20 >> I'm not seeing this behavior. What I'm seeing is that the list needs = to be populated before calling the namespace.put() in the serializer and = then >> it doesn't update/reflect any changes to the list after that. >> Gerrick >>=20 >> On Thu, Oct 21, 2010 at 6:23 AM, Greg Brown wrote: >> > In your example what happens when you change the ArrayList = tableDataInList? >> > is the change automatically fired in the table? or do I need a = listener? >>=20 >> Yes, ArrayList fires change events when its content is modified, so = the table will automatically update in response. >>=20 >>=20 >=20 >=20 >=20 --Apple-Mail-14-145587034 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii Glad to hear that you got it working.  :-)

On Oct 21, 2010, at 3:40 PM, Gerrick Bivins wrote:

Hi Greg,
I got this to work. The main issue was I wasn't setting things up in the bxml properly. Here is what I ended up doing:
1) define the list in bxml (as you suggested):
      <bxml:define xmlns:collections="org.apache.pivot.collections">
         <collections:ArrayList bxml:id="tableDataInList"/>
     </bxml:define>
2) Then in my java code, I have:
   class SomeWindowWithTable extends Window implements Bindable
   {
      ...
      @BXML private List tableDataInList;
      ...
   }

3) Any time I want to modify the view in the table:
    in java:
       this.tableDataInList.clear(); //clears the table
    in script:
       
<PushButton buttonData="PushButton">
            <buttonPressListeners>
            function buttonPressed(button) {
                tableDataInList.clear();
            }
            </buttonPressListeners>

        </PushButton>
I was confused about what was needed to be defined and where.

Works like a champ now!
Thanks for the patience!
Gerrick
On Thu, Oct 21, 2010 at 11:59 AM, Greg Brown <gkbrown@mac.com> wrote:
Can you try running the attached example and let me know what happens when you click the button? Easiest way to launch it is via the Eclipse plugin, which you can get here:


If you don't use Eclipse you can launch it via ScriptApplication directly. Let me know if you need any help with that.

G



On Oct 21, 2010, at 11:01 AM, Gerrick Bivins wrote:

Hi Greg,lello,

I'm not seeing this behavior. What I'm seeing is that the list needs to be populated before calling the namespace.put() in the serializer and then
it doesn't update/reflect any changes to the list after that.
Gerrick

On Thu, Oct 21, 2010 at 6:23 AM, Greg Brown <gkbrown@mac.com> wrote:
> In your example what happens when you change the ArrayList tableDataInList?
> is the change automatically fired in the table? or do I need a listener?

Yes, ArrayList fires change events when its content is modified, so the table will automatically update in response.






--Apple-Mail-14-145587034--