This is what I would do:

Set the resultFormat=”e4x”

Create an instance variable for the main dataProvider:

private var _xmlDpMain:XML;

Have the result event call a result handler function, and in that do:

_xmlDpMain = event.result; //set the global var value

trace(_xmlDpMain.toXMLString()); //to be sure I have what I expect

 

bind the main combobox to _xmlDPMain.Prov (whatever works for the main combo).

 

In a click/change event on the main combobox call a function and do this:

Var xmlDpDetail:XML = XML(comboMain.selectedItem);    //the XML function might not be required, I still get tripped ub by data type issues.


Assign that var to the detail combobox dataProvider:

comboDetail.dataProvider = xmlDpDetail;

 

Let us know.

 

Tracy


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jamie O
Sent: Friday, September 15, 2006 12:35 PM
To: [email protected]
Subject: [flexcoders] Re: Multiple XML loads?

 

God @(#$& do I not so much enjoy being at the bottom of a learning
curve. I can't fathom why putting the .send() into a function which is
called when my button is pushed didn't occur to me but, well, it
didn't. Thank you Tracy!

The second piece that I am now probably doing something very stupid
with is the format of the data and traversing. I haven't used XML a
LOT but I understand the basics of dot notation and have the Flex
'Traversing XML Structures' document printed for reference.

I have been able to populate combobox using the labelField and
dataProvider when the HTTPService is default format (object). However
I am trying to do a lookup in the XML based on the item a user selects
from that combobox and populate a second combobox with details of
children of that selected element. According to documentation if the
HTTPService is set as XML or e4x the following syntax should work in
the Change event:

{XML_PostCode.lastResult.Prov.City.Streets.(@streetname ==
cmbStreet.selectedLabel).NumberRangeLow}

Any attempts I did to 'stub' the HTTPService and use mx:Model or
mx:XML just went very badly for me. Any help would be appreciated.

--- In [EMAIL PROTECTED]ups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> I am not sure I understand "because you don't know which feed to pull at
> runtime".
>
>
>
> Using AS code you can change the URL of the HTTPService call and invoke
> send() at will.
>
>
>
> If you need to keep track of which result goes with which send, you can
> use the ACT pattern, that allows you to set and retrieve data in an
> AsyncToken.
>
>
>
> Tracy
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com [mailto:[EMAIL PROTECTED]ups.com] On
> Behalf Of Jamie O
> Sent: Monday, September 11, 2006 9:25 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] Multiple XML loads?
>
>
>
> Hi all,
>
> I have one conceptual/programming question right now I'm struggling
> with. Say in the blogreader sample app tutorial, you wanted to have
> several buttons to read several different RSS or XML feeds. My
> attempts using HTTPService have failed because you don't know which
> feed to pull at runtime or been able to use a variable in the
> HTTPService url. Other attempts have been equally unsuccessful.
>
> Put the code from that tutorial in below for reference.
> Any help thanks!
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to