Thanks Matt :]
Much appreciated.


On 9/20/06, Matt Chotin <[EMAIL PROTECTED]> wrote:

I think we made that change between beta3 and release so if things are working for you now I believe you're set.  But your preferred choice is preferred by us too I think J

 

Matt

 


From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of nwebb
Sent: Tuesday, September 19, 2006 8:59 AM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] Data Binding Question - will both work?

 

Hi, I've just seen part of a Flex training video that I think is incorrect or outdated (beta 3 was being used at the time)
I just want to double-check that this really is the case.

The video says that the code below would *not* take full advantage of data binding (ie  the data will initially appear in the DataGrid, but it will not stay updated):

<mx:HTTPService id="heroesDataRequest" url="" />
<mx:DataGrid dataProvider="{heroesDataRequest.lastResult.superheroes.hero}" />

However, I read in the Flex 2 docs that an HTTPService request will, by deault return an ArrayCollection (makeObjectsBindable is true by default), and I am using the data binding syntax in the form of the curly braces. Furthermore, in order to try and test, I used buttons to change the data in the HTTPService's lastResult object, and the changes do always seem to be reflected in my DataGrid:

<mx:HTTPService id="heroesDataRequest" url="" makeObjectsBindable="true" />
<mx:DataGrid dataProvider="{heroesDataRequest.lastResult.superheroes.hero }"    />
<mx:Button label="button 1" click="heroesDataRequest.lastResult.superheroes.hero[0].name = 'AAA';" />
<mx:Button label="button 2" click="heroesDataRequest.lastResult.superheroes.hero [0].name = 'BBB';" />

The tutorial goes on to say that to make binding work properly I should use the HTTPServices 'result' event handler, and assign the data to a bindable ArrayCollection variable that I create - this is probably my preferred choice anyway, but I am curious to know whether both ways are equally appropriate.

Can I safely say that data binding is working fully in the first example, or could there be scenarios in which it will not work but where the alternative method would? If so, could someone enlighten me? I'm not yet confident of the best way to check/debug this kind of thing myself.

Cheers,
Neil


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to