<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minHeight="0" width="910" height="1000"
creationComplete="serviceEventList.send()">
<fx:Declarations>
<mx:HTTPService id="serviceEventList" url="http://10.1.1.203/asp/list/event_events_liste.asp" result="resultHandler(event)" fault="faultHandler(event)" />
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
[Bindable]
private var eventList:ArrayCollection;
private function resultHandler(event:ResultEvent):void {
eventList = event.result.row;
//Alert.show(eventList.getItemAt(0).EID.toString());
}
private function faultHandler(event:FaultEvent):void {
Alert.show(event.fault.faultString, event.fault.faultCode);
}
private function listItemRendFunc(item:Object):ClassFactory {
var cla:Class = event_liste;
switch (item.type) {
case "P1V":
cla = event_liste;
break;
case "P1A":
cla = event_liste2;
break;
default:
break;
}
return new ClassFactory(cla);
}
]]>
</fx:Script>
<s:Button x="10" y="10.25" label="Button"/>
<s:Button x="10" y="39.7" label="Button"/>
<s:Button x="10" y="69.15" label="Button"/>
<s:DataGroup x="105" y="14" width="700" height="200" dataProvider="{eventList}" itemRendererFunction="listItemRendFunc">
<s:layout>
<s:TileLayout/>
</s:layout>
</s:DataGroup>
</s:Application>
|