Hello. I do not find what the concept of error is because it does not work "binding" from the beginning, but in the method refresh . Don't load the data for default.
Thk. <?xml version="1.0" encoding="utf-8"?> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:j="library://ns.apache.org/royale/jewel" xmlns:js="library://ns.apache.org/royale/basic" width="100%" height="100%"> <fx:Script> <![CDATA[ import org.apache.royale.events.Event; import org.apache.royale.collections.ArrayList; [Bindable] private var data:ArrayList = new ArrayList( [ {label:'Africa' ,code: '001'}, {label:'America',code: '002'}, {label:'Asia' ,code: '003'}, {label:'Europa' ,code: '004'}, {label:'Oceania',code: '005'}, ]); private function refresh(e:Event):void { dg.dataProvider = this.data; } ]]> </fx:Script> <j:initialView> <j:View> <j:DataGrid id="dg" width="400" height="200" dataProvider="{data}"> <j:columns> <j:DataGridColumn label="Label" dataField="label"/> <j:DataGridColumn label="Code" dataField="code"/> </j:columns> </j:DataGrid> <j:Button id="btnRefresh" text="Refresh Me" click= "refresh(event)"/> </j:View> </j:initialView> </j:Application>
