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=12h2oicpq/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1123656871/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/
 
<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"; 
    pageTitle="Incident Action Tracker" width="100%" marginLeft="0" 
marginRight="0" height="100%"
  xmlns="*" initialize="incidentRO.getCurrentSummary().send()" 
        >


        <mx:Model id="sectionModel">
    <regionx namex="Open - In Progress" revenue="1"/>
    <regionx namex="Open - Past Due" revenue="2"/>
    <regionx namex="Resolved" revenue="3"/>     
    <regionx namex="Completed" revenue="4"/>
        </mx:Model>     
         
    <mx:Script>
        function processCurrentItems()
                {
                        sectionModel.regionx[0].revenue = 13;
                        sectionModel.regionx[1].revenue = 14;
                        sectionModel.regionx[2].revenue = 15;                   
                        sectionModel.regionx[3].revenue = 16;   
                }
    </mx:Script>

        <mx:RemoteObject id="incidentRO" 
endpoint="@ContextRoot()/flashservices/gateway" source="Incident.incident">
     <mx:method name="getCurrentSummary"   
result="processCurrentItems(event.result)" />                         
        </mx:RemoteObject> 
        
   

<mx:List dataProvider="{sectionModel.regionx}" labelField="revenue"/>
<mx:Label text="{sectionModel.regionx[0].revenue}"/>


</mx:Application>

Reply via email to