Hi Guys
I am trying to retrieve values form the database PostGres. I used REST
calls for fetching the data and i am successful in binding that data
with the data Provider of Tree control.
Now my problem is that if I inserted any entry in the database, it
will not update the Tree control directly. Once i refresh the page it
shows the inserted entry. Can some one explain what 's the best way of
dynamically synchronizing my Tree Control (UI) with the database.
Any help and guidance or approach will be highly appreciated.
Thanks
Anuj
/*Here's the small piece of code*/
<mx:HTTPService id="devicesXML" method="GET" resultFormat="e4x"
url="http://10.80.3.56:8182/config/devices"
result="devicesXMLHandler(event)" showBusyCursor="true">
<mx:request>
<url>http://10.1.3.36:8182/config/devices</url>
</mx:request>
</mx:HTTPService>
private var devicesList:XMLList;
[Bindable]
private var devicesCollection:XMLListCollection;
private function
devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;
devicesCollection = new
XMLListCollection(devicesList);
}
<mx:Tree width="100%" height="100%"
dataProvider="{devicesCollection}"
labelField="@id"
dropEnabled="false"
dragEnabled="true"
dragComplete="onTreeDragComplete(event)"
dragMoveEnabled="false"
labelFunction="treeLabel"
change="populateForm(event)"
/>