12/17/2009 7:27:47 AM
Title:
Flex Server Browser
I need to Design a Component showing files from various folder in the server..
I will be getting an xml file based on the xml file i need to show various elements ie folder subfolders,and their corresponding elements in the panel with detail and tiled view.
Any one please help me in startup.
12/17/2009 9:14:33 AM
To create a server browser you need to provide an xml file as data provider to Tree component in flex. To load that xml I am using httpservice.
Your xml structure should look like this.
<?xml version='1.0' encoding='utf-8'?>
<folders>
<dir name='Folder 1'>
<dir name='Fruits'>
<dir name='Orange'/>
</dir>
<dir name='Juices'>
<dir name='Apple'/>
<dir name='Pineapple'/>
</dir>
</dir>
<dir name='Phones'>
<dir name='Samsung Android'/>
<dir name='iphone'/>
</dir>
</folders>
Code in flex to load and populate the xml file as tree component in flex.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="loadTreeXML.send()">
<mx:HTTPService id="loadTreeXML" url="treexml.xml" resultFormat="e4x" />
<mx:Tree y="10" width="278" horizontalScrollPolicy="auto" height="295" id="mytree" dataProvider="{loadTreeXML.lastResult.dir}" horizontalCenter="0" labelField="@name"/>
<mx:Button y="313" label="Update XML Data" click="loadTreeXML.send()" horizontalCenter="0" width="188"/>
</mx:Application>