[flexcoders] How call to a function declared in MXML file from ActionScript class ?
Hello :) I created a dataGrid in a file MXML like this : * mx:Panel title= Handing Data height=100% width=100% paddingTop=10 paddingLeft=10 paddingRight=10 !--mx:Label width=100% color=blue text=Select a row in the DataGrid control./-- mx:DataGrid id=dg name=dataGrid width=100% editable=true resizableColumns=true mx:columns mx:DataGridColumn dataField=variable headerText=Variable / mx:DataGridColumn dataField=type headerText=Type / mx:DataGridColumn dataField=value headerText=Value / mx:DataGridColumn dataField=operation headerText=Operation / /mx:columns /mx:DataGrid mx:HBox width=100% height=100% mx:Button name=validate label=Validate click={retreiveData(4,bpmnDataComponent)} / mx:Button name=cancel label=Cancel click={display(bpmnDataComponent)}/ mx:Button name=add label=Add Data click={fillDataGridData2(start)}/ /mx:HBox /mx:Panel and i created a function called retreiveDatalike this in the same Script : public function retreiveData(index : int , bpmnDataComponent : BpmnDataComponent): void { var dp: ListCollectionView = dg.dataProvider as ListCollectionView; if(dp==null){ //dg.dataProvider = handData; } else { Alert.show(longueur de DP+dp.length.toString()); var Objec : Object = dp.getItemAt(index); bpmnDataComponent.Variable = Objec.variable; bpmnDataComponent.Value = Objec.value; bpmnDataComponent.Type = Objec.type; } } And i called this function retreiveDatawhen i clik in the button validate in order to test if the function works well or not :) So it works well My aim is to call this function retreiveData from an actionScript but when i do this : private function upateData(event:Event):void { var bpmnFigureData : BpmnFigureData = new BpmnFigureData(); // BpmnFigureData : the name of the MXML FILE bpmnFigureData.width=300; bpmnFigureData.height=300; bpmnFigureData.retreiveData(1,this); this.addChild(bpmnFigureData); } But unfortunatelley it didn't do what i asked ?? So my question how we can call function which be applicated in DATAGRID from an ActionScript Class ..??? Any help please :(:( :( :( Thank you very much _ Découvrez comment SURFER DISCRETEMENT sur un site de rencontres ! http://clk.atdmt.com/FRM/go/206608211/direct/01/
Re: [flexcoders] How call to a function declared in MXML file from ActionScript class ?
create an object of that class and use that function make it function as public in that class. then you may able to access it. --- On Mon, 26/4/10, Nini7016 Nini7016 nahloulaha...@hotmail.com wrote: From: Nini7016 Nini7016 nahloulaha...@hotmail.com Subject: [flexcoders] How call to a function declared in MXML file from ActionScript class ? To: flexcoders@yahoogroups.com Date: Monday, 26 April, 2010, 10:10 AM Hello :) I created a dataGrid in a file MXML like this : * mx:Panel title= Handing Data height=100% width=100% paddingTop= 10 paddingLeft= 10 paddingRight= 10 !--mx:Label width=100% color=blue text=Select a row in the DataGrid control./-- mx:DataGrid id=dg name=dataGrid width=100% editable=true resizableColumns= true mx:columns mx:DataGridColumn dataField=variable headerText= Variable / mx:DataGridColumn dataField=type headerText= Type / mx:DataGridColumn dataField=value headerText= Value / mx:DataGridColumn dataField=operatio n headerText= Operation / /mx:columns /mx:DataGrid mx:HBox width=100% height=100% mx:Button name=validate label=Validate click={retreiveDat a(4,bpmnDataComp onent)} / mx:Button name=cancel label=Cancel click={display( bpmnDataComponen t)}/ mx:Button name=add label=Add Data click={fillDataGri dData2(start) }/ /mx:HBox /mx:Panel and i created a function called retreiveData like this in the same Script : public function retreiveData( index : int , bpmnDataComponent : BpmnDataComponent) : void { var dp: ListCollectionView = dg.dataProvider as ListCollectionView; if(dp==null) { //dg.dataProvider = handData; } else { Alert.show( longueur de DP+dp.length. toString( )); var Objec : Object = dp.getItemAt( index); bpmnDataComponent. Variable = Objec.variable; bpmnDataComponent. Value = Objec.value; bpmnDataComponent. Type = Objec.type; } } And i called this function retreiveData when i clik in the button validate in order to test if the function works well or not :) So it works well My aim is to call this function retreiveData from an actionScript but when i do this : private function upateData(event: Event):void { var bpmnFigureData : BpmnFigureData = new BpmnFigureData( ); // BpmnFigureData : the name of the MXML FILE bpmnFigureData. width=300; bpmnFigureData. height=300; bpmnFigureData. retreiveData( 1,this); this.addChild( bpmnFigureData) ; } But unfortunatelley it didn't do what i asked ?? So my question how we can call function which be applicated in DATAGRID from an ActionScript Class ..??? Any help please :(:( :( :( Thank you very much Envie de naviguer sur Internet sans laisser de trace? La solution avec Internet Explorer 8
Re: [flexcoders] How call to a function declared in MXML file from ActionScript class ?
Where do you set the dataProvider of the DataGrid? What is the bpmnDataComponent that you pass to the retreiveData() function? Haykel Ben Jemia Allmas Web RIA Development http://www.allmas-tn.com On Mon, Apr 26, 2010 at 11:10 AM, Nini7016 Nini7016 nahloulaha...@hotmail.com wrote: Hello :) I created a dataGrid in a file MXML like this : * mx:Panel title= Handing Data height=100% width=100% paddingTop=10 paddingLeft=10 paddingRight=10 !--mx:Label width=100% color=blue text=Select a row in the DataGrid control./-- mx:DataGrid id=dg name=dataGrid width=100% editable=true resizableColumns=true mx:columns mx:DataGridColumn dataField=variable headerText=Variable / mx:DataGridColumn dataField=type headerText=Type / mx:DataGridColumn dataField=value headerText=Value / mx:DataGridColumn dataField=operation headerText=Operation / /mx:columns /mx:DataGrid mx:HBox width=100% height=100% mx:Button name=validate label=Validate*click={retreiveData(4,bpmnDataComponent)} * / mx:Button name=cancel label=Cancel click={display(bpmnDataComponent)}/ mx:Button name=add label=Add Data click={fillDataGridData2(start)}/ /mx:HBox /mx:Panel and i created a function called *retreiveData * like this in the same Script : public function retreiveData(index : int , bpmnDataComponent : BpmnDataComponent): void { var dp: ListCollectionView = dg.dataProvider as ListCollectionView; if(dp==null){ //dg.dataProvider = handData; } else { Alert.show(longueur de DP+dp.length.toString()); var Objec : Object = dp.getItemAt(index); bpmnDataComponent.Variable = Objec.variable; bpmnDataComponent.Value = Objec.value; bpmnDataComponent.Type = Objec.type; } } And i called this function *retreiveData * when i clik in the button validate in order to test if the function works well or not :) So it works well My aim is to call this function *retreiveData *from an actionScript but when i do this : private function upateData(event:Event):void { var bpmnFigureData : BpmnFigureData = new BpmnFigureData(); // BpmnFigureData : the name of the MXML FILE bpmnFigureData.width=300; bpmnFigureData.height=300; bpmnFigureData.retreiveData(1,this); this.addChild(bpmnFigureData); } But unfortunatelley it didn't do what i asked ?? So my question how we can call function which be applicated in DATAGRID from an ActionScript Class ..??? Any help please :(:( :( :( Thank you very much -- Envie de naviguer sur Internet sans laisser de trace? La solution avec Internet Explorer 8 http://clk.atdmt.com/FRM/go/207186970/direct/01/