Anitha
04-08-2008, 12:31 PM
Hi all,
I have one problem in my project.Any idea plz??
For my project, I have created one MXML component based on panel.That panel contains one View stack container which contains the two childs named chartVBox and grid VBox.And also I have one toggle buttonbar .The dataprovider property of togglebuttonbar is the viewstack.
Here I retrive all the results from my asp.net webservice with some selectionperiod query.
I am afraid that you cant understand my design.Please refer my source.I hope that will help you to understand.
<mx:ViewStack id="vs" width="100%" height="100%">
<mx:VBox id="chartVBox" icon="@Embed('icon_chart.png')">
<mx:LineChart id="chart" width="100%" height="100%">
--------
</mx:VBox>
<mx:VBox id= "gridVBox" icon="@Embed('icon_grid.png')">
<mx:DataGrid id="grid" width="100%" height="100%">
--------
</mx:VBox>
</mx:ViewStack>
<mx:ControlBar height="37">
<mx:ToggleButtonBar dataProvider="{vs}" id="toggle"/>
</mx:ControlBar>
Everything Ok.But when I select my selectionperiod, the results displayed in my chartVBox successfully. When I click the togglebutton to change my view mode to gridVBox,the results not shown.
//My script is,
private function remotingHandler(event:ResultEvent):void
{
var answer:ArrayCollection = event.result.Tables ["annualresult"].Rows;
var ans:Array=ArrayUtil.toArray(answer);
chart.dataProvider=answer;
grid.dataProvider=answer; // I think,in this step I miss something //
}
//How can I retrieve the same result in my second gridVBox with the same results in my First chartVBox [My first chartVBox works successfully]. Any idea please??
Anitha.
I have one problem in my project.Any idea plz??
For my project, I have created one MXML component based on panel.That panel contains one View stack container which contains the two childs named chartVBox and grid VBox.And also I have one toggle buttonbar .The dataprovider property of togglebuttonbar is the viewstack.
Here I retrive all the results from my asp.net webservice with some selectionperiod query.
I am afraid that you cant understand my design.Please refer my source.I hope that will help you to understand.
<mx:ViewStack id="vs" width="100%" height="100%">
<mx:VBox id="chartVBox" icon="@Embed('icon_chart.png')">
<mx:LineChart id="chart" width="100%" height="100%">
--------
</mx:VBox>
<mx:VBox id= "gridVBox" icon="@Embed('icon_grid.png')">
<mx:DataGrid id="grid" width="100%" height="100%">
--------
</mx:VBox>
</mx:ViewStack>
<mx:ControlBar height="37">
<mx:ToggleButtonBar dataProvider="{vs}" id="toggle"/>
</mx:ControlBar>
Everything Ok.But when I select my selectionperiod, the results displayed in my chartVBox successfully. When I click the togglebutton to change my view mode to gridVBox,the results not shown.
//My script is,
private function remotingHandler(event:ResultEvent):void
{
var answer:ArrayCollection = event.result.Tables ["annualresult"].Rows;
var ans:Array=ArrayUtil.toArray(answer);
chart.dataProvider=answer;
grid.dataProvider=answer; // I think,in this step I miss something //
}
//How can I retrieve the same result in my second gridVBox with the same results in my First chartVBox [My first chartVBox works successfully]. Any idea please??
Anitha.