Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" verticalAlign="middle">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
[Bindable]
private var diamondList:XMLList;
public function handleXML(event:ResultEvent):void{
diamondList = event.result.diamond as XMLList;
}
public function handleFault(event:FaultEvent):void{
Alert.show(event.fault.faultString, "Error");
}
]]>
</mx:Script>
<mx:HTTPService result="handleXML(event);"
fault="handleFault(event);" resultFormat="e4x" id="xmlRPC"
method="GET" url="http://localhost/zzz_stuff/flex/diamondSearch/
zzz_flex.php" useProxy="false">
<mx:request xmlns="">
<lot_number>{lot_number.text}</lot_number>
<price_from>price.values[0]</price_from>
<price_to>price.values[1]</price_to>
</mx:request>
</mx:HTTPService>
<mx:Label x="34" y="32" text="Lot Number" width="77" height="18"
textAlign="right" fontWeight="bold"/>
<mx:Label x="34" y="58" text="Price" width="77" height="18"
textAlign="right" fontWeight="bold"/>
<mx:TextInput x="130" y="32" id="lot_number" width="160" height="22"/
>
<mx:HSlider x="130" y="62" labels="['0','10000']" id="price"
maximum="10000" thumbCount="2" showTrackHighlight="true"
values="[4900, 5000]"/>
<mx:Button x="130" y="106" label="Get Diamonds"
click="xmlRPC.send();" width="160" height="22"/>
<mx:DataGrid dataProvider="{diamondList}" x="34" y="141" width="1068"
height="459" id="diamondSearchList" editable="false" enabled="true">
<mx:columns>
<mx:DataGridColumn headerText="Lot Number"
dataField="lot_number" />
<mx:DataGridColumn headerText="Carat" dataField="carat" />
<mx:DataGridColumn headerText="Shape" dataField="shape" />
<mx:DataGridColumn headerText="Color" dataField="color" />
<mx:DataGridColumn headerText="Clarity" dataField="clarity" /
>
<mx:DataGridColumn headerText="Price" dataField="price_a" />
</mx:columns>
</mx:DataGrid>
</mx:Application>
and here is the XML
- <diamonds>
- <diamond>
<lot_number>10318</lot_number>
<carat>2.25</carat>
<shape>OV</shape>
<color>H</color>
<clarity>VS2</clarity>
<price_a>4950</price_a>
</diamond>
- <diamond>
<lot_number>10396B</lot_number>
<carat>2.06</carat>
<shape>TR</shape>
<color>I</color>
<clarity>SI1</clarity>
<price_a>4900</price_a>
</diamond>
- <diamond>
<lot_number>10543</lot_number>
<carat>1.15</carat>
<shape>PS</shape>
<color>D</color>
<clarity>VS2</clarity>
<price_a>4900</price_a>
</diamond>
- <diamond>
<lot_number>10586</lot_number>
<carat>1.76</carat>
<shape>OV</shape>
<color>E</color>
<clarity>SI1</clarity>
<price_a>4920</price_a>
</diamond>
- <diamond>
<lot_number>10600</lot_number>
<carat>2.08</carat>
<shape>OV</shape>
<color>I-J</color>
<clarity>SI2</clarity>
<price_a>4950</price_a>
</diamond>
- <diamond>
<lot_number>B-6052A</lot_number>
<carat>2.08</carat>
<shape>AS</shape>
<color>H</color>
<clarity>VS2</clarity>
<price_a>4950</price_a>
</diamond>
</diamonds>
(the dashes are from IE)
Everything looks ok to me. Can anyone help me out?
Thanks,
-Chris