If you want an Array to act as a DataProvider, you must use the
DataProvider methods, as these fire the relevant events to let
controls know about changes

http://www.cflex.net/showfaq.cfm?Object=faq&channelID=1&faqtype=&defaultfields=&defaultValues=#Question398

http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/listclasses/DataProvider.html


hope this helps

daniel



--- In flexcoders@yahoogroups.com, Tariq Ahmed <[EMAIL PROTECTED]> wrote:
> Hi Mika, thanks! That lead me down the right track. Your first 
> suggestion is basically the solution.
> 
> Thanks!
> 
> 
> Mika Kiljunen wrote:
> 
> > Perhaps you should modify the values on the model through the list's 
> > dataProviders editField or replaceItemAt, since the changes made to 
> > the model directly won't be reflected to the list?
> >
> > You could set the list's dataprovider once more after you modify the 
> > list directly, this might help too.
> >
> >  
> >
> > So something like this:
> >
> >                        
> >
> > <mx:List id="myList" dataProvider="{sectionModel.region}" 
> > labelField="revenue"/>
> >
> >         function processCurrentItems()
> >         {
> >             myList.dataProvider.replaceItemAt(0,13);
> >             myList.dataProvider.replaceItemAt(1,14);
> >             myList.dataProvider.replaceItemAt(2,15);
> >             myList.dataProvider.replaceItemAt(3,16);
> >
> >         }
> >
> >  
> >
> > OR
> >
> >  
> >
> > <mx:List id="myList" dataProvider="{sectionModel.region}" 
> > labelField="revenue"/>
> >
> >         function processCurrentItems()
> >         {
> >             sectionModel.region[0].revenue = 13;
> >             sectionModel.region[1].revenue = 14;
> >             sectionModel.region[2].revenue = 15;          
> >             sectionModel.region[3].revenue = 16;  
> >
> >             myList.dataProvider = sectionModel;
> >
> >         }
> >
> >  
> >
> >  
> >
> > -Mika
> >
> >  
> >
> >
------------------------------------------------------------------------
> >
> > *From:* flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] 
> > *On Behalf Of *Tariq Ahmed
> > *Sent:* 10. elokuuta 2005 7:54
> > *To:* flexcoders@yahoogroups.com
> > *Subject:* [flexcoders] An interesting problem with models....
> >
> >  
> >
> > A model, remoteobject, and a list walk into a bar, and the bartender 
> > ... j/k
> >
> > I got a weird problem that I've narrowed down into a simple
> > reproduceable test case.
> >
> > Got a simple model:
> >     <mx:Model id="sectionModel">
> >     <region revenue="1"/>
> >     <region revenue="2"/>
> >     <region revenue="3"/>  
> >     <region revenue="4"/>
> >     </mx:Model>  
> >
> > And I got a function that just hard code updates the values:
> >         function processCurrentItems()
> >         {
> >             sectionModel.region[0].revenue = 13;
> >             sectionModel.region[1].revenue = 14;
> >             sectionModel.region[2].revenue = 15;          
> >             sectionModel.region[3].revenue = 16;  
> >         }
> >
> > And then these two components displaying data:
> > <mx:List dataProvider="{sectionModel.region}" labelField="revenue"/>
> > <mx:Label text="{sectionModel.region[0].revenue}"/>
> >
> > Now the list should show 13,14,15,16 after the above function is
called,
> > and it does if called from the Application initialize call. But,
if it's
> > called as a result from a remoteObject call, the model is updated, but
> > the List doesn't the change, however the Label does.
> >
> > Attached is a working sample.
> >
> > It turns out the List is updating in the remoteobject case, but the
> > display only updates if you move your mouse over each individual item.
> > Though why it works fine if the same code is executed as a result
of an
> > initialize call is beyond me.
> >
> > In the actual problem that I have - instead of a list I have a
PieChart,
> > and its display does not update even though the model is updated
(though
> > to complicate things the exact same code works on another machine).
> >
> > Any ideas? Some caching thing?
> >




------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hu9ft8s/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123758457/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to