xml binding to datagrid
hi,
trying bind xmlfile datagrid. have file name xxxx.xml in folder called assets in application. using xmllistcollection , trying bind datagrid. code
<mx:xml id="sample" source="{assets/xxxx.xml}" />
<mx:xmllistcollection id="samplexml" source="{sample.samplenode}" />
i following error
data binding expressions not supported attributes processed @ compile time.
trying bind xmlfile datagrid. have file name xxxx.xml in folder called assets in application. using xmllistcollection , trying bind datagrid. code
<mx:xml id="sample" source="{assets/xxxx.xml}" />
<mx:xmllistcollection id="samplexml" source="{sample.samplenode}" />
i following error
data binding expressions not supported attributes processed @ compile time.
i think error saying xmllistcollection can't created because compiler doesn't know structure of xml @ compile time (because hasn't finished loading xml file). you'll have listen event , create xmllistcollection, , datagrid if wanted. think 'load' event need, eg. (this untested!)
<mx:xml id="sample" source="{assets/xxxx.xml}" load="createxmllc()" />
<mx:xmllistcollection id="samplexml" />
<mx:script>
<![cdata[
private function createxmllc():void
{
samplexml = new xmllistcollection(sample.samplenode);
}
]]>
</mx:script>
<mx:xml id="sample" source="{assets/xxxx.xml}" load="createxmllc()" />
<mx:xmllistcollection id="samplexml" />
<mx:script>
<![cdata[
private function createxmllc():void
{
samplexml = new xmllistcollection(sample.samplenode);
}
]]>
</mx:script>
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment