Greeitngs,
I have, what should be, a very simple need. I am using an
mxml module basedf on a Panel. The basic jist is I have the state
determined by a var passed, with a value of Pie or Bar, which I use
a the default state. On creationComplete I execute the remote
object and pass it to either the Pie chart state or the Bar chart
state. I don't get any error's, it's just blank. Here is the code.
I've poked around and made a lot of changes trying to debug it, so
just ignore any wierdness. The pie chart is duped in the bar state
just to make the bar chart wasn't causing the issue.
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="
http://www.adobe.com/2006/mxml"x="1" y="0"
layout="absolute" width="100%" height="100%"
horizontalScrollPolicy="off" includeInLayout="true"
visible="true" borderColor="#FFFFFF" borderThickness="0"
borderThicknessBottom="0" borderThicknessLeft="0"
borderThicknessRight="0" borderThicknessTop="0"
dropShadowEnabled="false" verticalAlign="top"
clipContent="true" headerHeight="1" useHandCursor="false"
currentState="Pie"
creationComplete="searchGetPointsAssigned.returnGroups_Points(AwardsDashboard_Variables);">
<mx:States>
<mx:State name="Pie">
<mx:AddChild>
<!-- Render Pie Chart -->
<mx:PieChart id="groupPieChart" height="100%"
width="100%" enabled="true" useHandCursor="true"
showAllDataTips="false" showDataTips="true" x="0" y="0">
<mx:series>
<mx:PieSeries nameField="GroupName" height="100%"
width="100%" field="TotalPoints"
labelPosition="insideWithCallout">
<mx:showDataEffect>
<mx:SeriesInterpolate minimumElementDuration="1000"
duration="1000" />
</mx:showDataEffect>
</mx:PieSeries>
</mx:series>
</mx:PieChart>
<mx:Legend id="chartLegend"
dataProvider="{groupPieChart}" labelPlacement="right"
includeInLayout="true"/>
</mx:AddChild>
</mx:State>
<mx:State name="Bar">
<mx:AddChild>
<!-- Render Pie Chart -->
<mx:PieChart id="groupPie2Chart" height="100%"
width="100%" enabled="true" useHandCursor="true"
selectionMode="none" showAllDataTips="false" showDataTips="true"
x="0" y="0">
<mx:series>
<mx:PieSeries nameField="GroupName" height="100%"
width="100%" field="TotalPoints"
labelPosition="insideWithCallout">
<mx:showDataEffect>
<mx:SeriesInterpolate minimumElementDuration="1000"
duration="1000" />
</mx:showDataEffect>
</mx:PieSeries>
</mx:series>
</mx:PieChart>
</mx:AddChild>
</mx:State>
</mx:States>
<mx:RemoteObject id="searchGetPointsAssigned"
showBusyCursor="true" destination="ColdFusion"
source="_assets_DashBoard.SearchEngine.searchIncludes.getPointsAssigned"
endpoint="
http://www.xxx.com/flex2gateway/"> <mx:method name="returnGroups_Points"
result="processReportTypesHandler(event)"
fault="mx.controls.Alert.show(event.fault.faultString)"/>
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import assets.Variables.AwardsDashboard_Variables;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.utils.ObjectUtil;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
//pass returned data to the chart dataprovider
private function
processReportTypesHandler(returnedReportTypes:ResultEvent):void
{
if (AwardsDashboard_Variables.cbRenderMethod == "Pie"){
groupPieChart.dataProvider = returnedReportTypes.result;
}
else if (AwardsDashboard_Variables.cbRenderMethod == "Pie"){
groupPie2Chart.dataProvider = returnedReportTypes.result;
}
}
;]]>
</mx:Script>
</mx:Panel>
I am assuming it is a fundemental issue with remoteobject
and states and what is visible to flash when but, I am pretty new
at this so what do I know. :)
Thanks for any input or suggestions.
-Kevin