Hmmm, alright I think I narrowed down the
problem and with coffee this morning I’m a bit clearer on the problem
here.
The binding is working fine (the class is bindable, so properties don’t
need to be – using Cairngorm 2) because I’ve tested the exact same
thing with a label/string and the same ICV/datagrid and it works….but my
chart won’t update. To make it real simple, I’ve got a basic
example:
<mx:DataGrid id="HourGrid"
dataProvider="{model.hourData}" width="100%"
height="100%">
<mx:columns>
<mx:Array>
<mx:DataGridColumn dataField="name"
headerText="Hour"/>
<mx:DataGridColumn dataField="revenue"
headerText="Revenue" labelFunction="dataGridCurrencyFormat"
textAlign="right"/>
</mx:Array>
</mx:columns>
</mx:DataGrid
<mx:LineChart id="salesChart"
dataProvider="{model.hourData}" showDataTips="true"
width="100%" height="100%"
dataTipFunction="formatDataTipTotals">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{model.hourData}"
categoryField="name" name="Hour"/>
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LinearAxis minimum="0" maximum="1500"
labelFunction="currencyFormat" name="Revenue"/>
</mx:verticalAxis>
<mx:series>
<mx:Array>
<mx:LineSeries
lineSegmentRenderer="mx.charts.renderers.LineRenderer" id="current"
yField="revenue" showDataEffect="{interpolate}" >
<mx:lineStroke>
<mx:Stroke color="#000000" weight="3"/>
</mx:lineStroke>
</mx:LineSeries>
</mx:Array>
</mx:series>
</mx:LineChart>
I’ve even removed everything from the LineChart besides the
horizontalAxis (removed dataTipFunctions,verticalaxis, etc…) making it a
5 lines of code chart and it doesn’t update even the horizontalAxis.
These are right next to each other in code as shown above.
As you can see my datagrid comes out fine, but my chart doesn’t update
and stays empty....
Ideas?
_________________________________________
Jonathan Miranda
Flexible Master of the Web
"Try not
to become a man of success, but a man of value." - Albert Einstein
HealthGrades: Guiding
NASDAQ:
HGRD
w (720)
963-3832
c (707)
761-0868
_________________________________________
The message contains confidential and/or
legally privileged information and is intended for use only by the indicated addressee.
If you are not the named addressee you should not disseminate, distribute, or
copy this e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail by mistake and delete this e-mail from your system. E-mail
transmissions cannot be guaranteed to be secure or error-free as information
could be intercepted, corrupted, lost, destroyed,arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any errors
or omissions in the contents of this message which arise as a result of e-mail
transmission. If verification is required please request a hard-copy version.
From:
Sent: Friday, March 24, 2006 2:05
AM
To:
Subject: RE: [flexcoders]
Cairngorm Model binding problem
You also need to put [Bindable]
in your ModelLocator class.
[Bindable]
public var ICV: ICollectionView;
Benoit Hediard
De :
Envoyé : vendredi 24 mars
2006 01:30
À :
Objet : [flexcoders]
Cairngorm Model binding problem
Alright,
I’m attempting to move my little dashboard to Cairngorm and it’s
going alright but now I’ve got a real basic problem and it’s
stumping me – I know it’s something little but I’m stuck. In
my ModelLocator instance I have an ICollectionView. Service gets called by
event/delegates and the command responder is setting the model.ICV
correctly….but my chart which uses dataProvider=”{model.ICV}”
isn’t updating. Now, since I made in my chart component:
[Bindable]
public var
model : ModelLocator = ModelLocator.getInstance();
<mx:LineChart id="salesChart"
dataProvider="{model.ICV}"….
And in my ModelLocator file:
public var ICV: ICollectionView;
I’m assuming the problem is somewhere in the binding – do I need to
broadcast an update event to the Chart….that doesn’t sound right
though, anytime an ICV changes I shouldn’t have to do that right? Bah,
having a headache isn’t helping….anyone got any ideas where I went
wrong?
_________________________________________
Jonathan Miranda
Flexible Master of the Web
"Try not to
become a man of success, but a man of value." - Albert Einstein
HealthGrades: Guiding
NASDAQ: HGRD
w (720)
963-3832
c (707)
761-0868
_________________________________________
The message
contains confidential and/or legally privileged information and is intended for
use only by the indicated addressee. If you are not the named addressee
you should not disseminate, distribute, or copy this e-mail. Please notify the
sender immediately by e-mail if you have received this e-mail by mistake and
delete this e-mail from your system. E-mail transmissions cannot be guaranteed
to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed,arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If verification
is required please request a hard-copy version.
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.