estructura de datos:
<?xml version="1.0" encoding="UTF-8" ?>
- <posters>
- <posting>
<id>1</id>
<emailaddress>g6g</emailaddress>
<message>g6g6</message>
<messagetopic>g6</messagetopic>
<postername>g6t6</postername>
</posting>
- <posting>
<id>2</id>
<emailaddress>g6g</emailaddress>
<message>g6g6</message>
<messagetopic>g6</messagetopic>
<postername>wreghr</postername>
</posting>
</posters>
codigo xml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="messageRequest.send()">
<mx:Script>
<![CDATA[
import mx.controls.*
private function filterFunc(item:Object):Boolean {
return item.text().match(new RegExp("^" + nameM.text, "i"));
}
]]>
</mx:Script>
<mx:XMLListCollection id="xmlListColl" source="{messageRequest.lastResult.posting}" filterFunction="filterFunc" />
<mx:HTTPService id="messageRequest" method="POST" resultFormat="e4x"
url="http://mi_maquina/myMessageBoard/messageBoardConnector.cfm">
<mx:request xmlns="">
<emailaddress>{}</emailaddress>
<message>{}</message>
<messagetopic>{}</messagetopic>
<postername>{}</postername>
</mx:request>
</mx:HTTPService>
<mx:Panel title="Datos BlackBerry" height="560" width="700"
paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10" x="22.95" y="9.1">
<mx:TabNavigator>
<mx:VBox label="Modificar">
<mx:VBox>
<mx:Form>
<mx:FormItem label="Poster Name:" >
<mx:TextInput id="nameM" change="{xmlListColl.refresh()}"/>
</mx:FormItem>
</mx:Form>
</mx:VBox>
<mx:Form>
<mx:DataGrid id="dgMessage" width="600"
dataProvider="{xmlListColl}" editable="true" >
<mx:columns>
<mx:DataGridColumn headerText="Poster Name"
dataField="postername" width="200"/>
<mx:DataGridColumn headerText="Email Address"
dataField="emailaddress" width="200"/>
<mx:DataGridColumn headerText="Message Topic"
dataField="messagetopic" width="200" />
</mx:columns>
</mx:DataGrid>
<mx:TextArea height="100" width="300" text="{dgMessage.selectedItem.message}"/>
<mx:Label text="Filtered: Showing {xmlListColl.length} record(s)" visible="{nameM.text.length > 0}" />
</mx:Form>
</mx:VBox>
</mx:TabNavigator>
</mx:Panel>
</mx:Application>
