I've tried this basic event handler with no success

Code:

<mx:HTTPService id="tempXML"
url="https://{customer.text}.mysite.net/interface.php?action=showopen&amp;operation=showassets&amp;format=xml&amp;opstatus=crit&amp;username={username.text}&amp;password={password.text}";
/>
<mx:Script>
<![CDATA[
import mx.collections.*;
[Bindable]
public var TileList1dp:ArrayCollection;

private function initData():void {
TileList1dp = new ArrayCollection(tempXML.lastResult.asset.fleet);
}
]]>
</mx:Script>


<mx:TileList dataProvider="{TileList1dp}"
width="344" backgroundColor="#000000" color="#ff0000" fontSize="27"
borderColor="#000000" columnWidth="300" rowHeight="50"
themeColor="#808080" fontWeight="bold" allowMultipleSelection="true"
id="TileList1" height="0" y="202" x="178"/>

I can look through fire bug and see that I am seeing the XML being
received but I am not seeing the data being displayed in the app.

I am trying to find an example of the result handler that will get the
data to the TileList.

I know that I am probably noobing this problem but I am still new and
unsure of how to receive. 



--- In flexcoders@yahoogroups.com, "markcavins" <[EMAIL PROTECTED]> wrote:
>
> I am trying to find an example of the result handler that will get the
> data to the TileList. Tracy's example is great but I am having a hard
> time making this work with my app. 
> 
> 
> --- In flexcoders@yahoogroups.com, "markcavins" <markcavins@> wrote:
> >
> > Thank you for this wonderful example and maybe I am just too much of a
> > noob at this but wouldn't this example just put every thing in a data
> > grid?
> > 
> > --- In flexcoders@yahoogroups.com, "Tracy Spratt" <tspratt@> wrote:
> > >
> > > It is difficult to debug problems when you bind directly to
> > lastResult.  Instead, use a result handler, in which you can inspect
> > yur data.
> > > Tracy
> > > 
> > > Sample code using HTTPService, e4x, handler function to populate a
> > list item.  
> > > Also shows usage of AsyncToken.
> > > 
> > > The DataGrid tag:
> > > <mx:DataGrid id="dg" dataProvider="{_xlcMyListData}" .../>
> > > 
> > > 
> > > The HTTPService tag:
> > > <mx:HTTPService id="service" resultFormat="e4x"
> > result="onResult(event)" fault="..../>
> > > 
> > > Script block declaration:
> > > import mx.rpc.Events.ResultEvent;
> > > [Bindable]private var _xlcMyListData:XMLListCollection;
> > > 
> > > Invoke send:
> > > var oRequest:Object = new Object();
> > > oRequest.Arg1 = "value1";
> > > var callToken:AsyncToken = service.send(oRequest);
> > > token.callId = "myQuery1";
> > > 
> > > Result Handler function:
> > > private function onResult(oEvent:ResultEvent):void  {
> > >   var xmlResult:XML = XML(event.result);                //converts
> > result Object to XML. can also use "as" operator
> > >   var xlMyListData:XMLList = xmlResult.myListData;      //depends on
> > xml format, is row data
> > >   _xlcMyListData = new XMLListCollection(xlMyListData); //wrap the
> > XMLList in a collection
> > >   trace(_xlcMyListData.toXMLString());                  //so you can
> > see exactly how to specify dataField or build labelFunction
> > >   var callToken:AsyncToken = oEvent.token;
> > >   var sCallId = callToken.callId;                       //"myQuery1"
> > >   switch(sCallId)  {                                    //Process
> > the result conditionally
> > >     case "myQuery1":
> > >       doQuery2();                                       //do
> > whatever. this example calls another data service query
> > >       break;
> > >     ... 
> > >   }
> > > }//onResult
> > > 
> > > ________________________________________
> > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
> > On Behalf Of markcavins
> > > Sent: Thursday, January 10, 2008 7:21 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] Re: XML List problems
> > > 
> > > another question would be if I need to add a result to the
HTTPService
> > > to get it to display and if so what would the result set need to be?
> > > 
> > > --- In flexcoders@yahoogroups.com, "markcavins" <markcavins@> wrote:
> > > >
> > > > This is the XML output for each asset
> > > > 
> > > > <asset id="aa44">
> > > > <name>333CCC</name>
> > > > <tag>abc232</tag>
> > > > <vin>11111111</vin>
> > > > <fleet>0052</fleet>
> > > > <type id="0">Standard</type>
> > > > <subtype id="4">STANDARD</subtype>
> > > > <exsid/>
> > > > <mileage>1946</mileage>
> > > > <location>Home</location>
> > > > <mileoffset>0</mileoffset>
> > > > <radioaddress/>
> > > > <mfg>GMC</mfg>
> > > > <inservice></inservice>
> > > > <inspdate id="555" type="34343">12/10/2002</inspdate>
> > > > &#8722;
> > > > <yardstat>
> > > > <yard/>
> > > > <stat timestamp="0"></stat>
> > > > </yardstat>
> > > > <opstatus timestamp="1190311036">1325465465</opstatus>
> > > > <gps></gps>
> > > > <homeloi/>
> > > > </asset>
> > > > 
> > > > 
> > > > All I am looking for is just that asset name.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > --- In flexcoders@yahoogroups.com, Alger Werft <alger.werft@>
wrote:
> > > > >
> > > > > To clarify:
> > > > >
> > > >
> > >
> >
>
http://livedocs.adobe.com/labs/flex3/langref/mx/rpc/http/mxml/HTTPService.html
> > > > > 
> > > > > There's a lastResult property but no result!
> > > > > 
> > > > > There's a result event which is fired when the HTTP response is
> > > loaded.
> > > > > This event has a result property.
> > > > >
> > > >
> > >
> >
>
http://livedocs.adobe.com/labs/flex3/langref/mx/rpc/events/ResultEvent.html
> > > > > 
> > > > > 
> > > > > What's the structure of your XML?
> > > > > 
> > > > > 
> > > > > markcavins schrieb:
> > > > > >
> > > > > > In that case I get the following error
> > > > > >
> > > > > > 1119: Access of possibly undefined property result through a
> > > reference
> > > > > > with static type mx.rpc.http.mxml:HTTPService.
> > > > > >
> > > > > > --- In flexcoders@yahoogroups.com 
> > > > > > <mailto:flexcoders%40yahoogroups.com>, Sheriff <sherif626@>
> wrote:
> > > > > > >
> > > > > > > it shouldnt be tempXML.lastResult, instead tempXML.result
> > > > > > >
> > > > > > >
> > > > > > > ----- Original Message ----
> > > > > > > From: markcavins <markcavins@>
> > > > > > > To: flexcoders@yahoogroups.com
> > > <mailto:flexcoders%40yahoogroups.com>
> > > > > > > Sent: Thursday, January 10, 2008 3:40:58 PM
> > > > > > > Subject: [flexcoders] XML List problems
> > > > > > >
> > > > > > > I have had some help from some others on this issue but the
> > battle
> > > > > > > continues and I am perplexed as to why this might be
> happening.
> > > > > > >
> > > > > > > I am grabbing a HTTPService from my site
> > > > > > >
> > > > > > > <mx:HTTPService id="tempXML"
> > > > > > > url="https://mysite. net/interface. php?action= showopen&
> > > > > > amp;operation= showassets& amp;format= xml&amp;opstatus =crit"
> > > > > > > />
> > > > > > >
> > > > > > > and displaying it in a TileList
> > > > > > >
> > > > > > > <mx:TileList dataProvider= "{tempXML. lastResult.
> asset.fleet} "
> > > > > > > width="344" backgroundColor= "#000000" color="#ff0000"
> > > fontSize="27"
> > > > > > > borderColor= "#000000" columnWidth= "300" rowHeight="50"
> > > > > > > themeColor=" #808080" fontWeight=" bold" allowMultipleSelect
> > > > ion="true"
> > > > > > > id="TileList1" height="0" y="202" x="178"/>
> > > > > > >
> > > > > > > and then refreshing the data every 5 minutes or when a user
> > > pushes a
> > > > > > > button.
> > > > > > >
> > > > > > > before I was trying to call the data with a mx:XML and the
> > > data was
> > > > > > > displaying but the data would not refresh. Looking
through the
> > > > docs it
> > > > > > > seems that that is the expected response. changing to the
> > Service
> > > > > > > request I can look through firebug and see that the
request is
> > > being
> > > > > > > made and that the server is returning the proper xml but
> now the
> > > > > > > TileList is not displaying any information.
> > > > > > >
> > > > > > > I have tried to look through the docs to see what might
be the
> > > cause
> > > > > > > but not solution has presented itself.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > __________________________________________________________
> > > > > > > Looking for last minute shopping deals?
> > > > > > > Find them fast with Yahoo! Search.
> > > > > >
> > > >
> >
http://tools.search.yahoo.com/newsearch/category.php?category=shopping 
> > > > > >
> > > >
> >
<http://tools.search.yahoo.com/newsearch/category.php?category=shopping>
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>


Reply via email to