Hi Tracy,

thanks for your answer. Unfortunately you skipped the really interesting part
how to reference the correct nodes/attributes in XML. At the moment I solved my
problem about the ComboBox by writing a method which extracts node values and
puts them into an array(), so this array can be bound directly to a
dataProvider of a ComboBox.

Now I have a very similar problem with a DataGrid. I have again XML in a string
( the framework I use delivers VO's as XML ) and I would like a DataGrid to
display my data. I defined a var vehicle =
XMLUtil.createXML(event.result).firstChild.childNodes; and this is the result,
if i bind vehicle to a TextArea;

<vehicle><C_0010>10</C_0010><C_0160>014</C_0160><C_0170>ADLY</C_0170><C_0180>sonstiges</C_0180><C_FahrzeugLangText
/><Tueren /><Aenderungs_KZ>X</Aenderungs_KZ><C_0190 /><C_0200 /><C_0210
/><C_220 /><C_0230 /><C_0240 /><C_0250 /><C_0260 /><C_0270 /><C_0280
/></vehicle>,
<vehicle><C_0010>10</C_0010><C_0160>011</C_0160><C_0170>ADLY</C_0170><C_0180>sonstiges</C_0180><C_FahrzeugLangText
/><Tueren /><Aenderungs_KZ>X</Aenderungs_KZ><C_0190 /><C_0200 /><C_0210
/><C_220 /><C_0230 /><C_0240 /><C_0250 /><C_0260 /><C_0270 /><C_0280
/></vehicle>,
<vehicle><C_0010>10</C_0010><C_0160>013</C_0160><C_0170>ADLY</C_0170><C_0180>sonstiges</C_0180><C_FahrzeugLangText
/><Tueren /><Aenderungs_KZ>X</Aenderungs_KZ><C_0190 /><C_0200 /><C_0210
/><C_220 /><C_0230 /><C_0240 /><C_0250 /><C_0260 /><C_0270 /><C_0280
/></vehicle>,
<vehicle><C_0010>10</C_0010><C_0160>013</C_0160><C_0170>ADLY</C_0170><C_0180>Vierräder
L2</C_0180><C_FahrzeugLangText>ATV
50</C_FahrzeugLangText><Tueren>0</Tueren><Aenderungs_KZ>X</Aenderungs_KZ><C_0190>2</C_0190><C_0200>0</C_0200><C_0210>49</C_0210><C_220
/><C_0230>0</C_0230><C_0240>040</C_0240><C_0250>0</C_0250><C_0260>1999</C_0260><C_0270>0</C_0270><C_0280
/></vehicle>,
<vehicle><C_0010>10</C_0010><C_0160>014</C_0160><C_0170>ADLY</C_0170><C_0180>Vierräder
L2</C_0180><C_FahrzeugLangText>ATV
50</C_FahrzeugLangText><Tueren>0</Tueren><Aenderungs_KZ>X</Aenderungs_KZ><C_0190>2</C_0190><C_0200>0</C_0200><C_0210>49</C_0210><C_220
/><C_0230>0</C_0230><C_0240>040</C_0240><C_0250>0</C_0250><C_0260>1999</C_0260><C_0270>0</C_0270><C_0280
/></vehicle>,
<vehicle><C_0010>10</C_0010><C_0160>011</C_0160><C_0170>ADLY</C_0170><C_0180>Vierräder
L5</C_0180><C_FahrzeugLangText>Go-Kart
125</C_FahrzeugLangText><Tueren>0</Tueren><Aenderungs_KZ>X</Aenderungs_KZ><C_0190>5</C_0190><C_0200>0</C_0200><C_0210>125</C_0210><C_220
/><C_0230>0</C_0230><C_0240>040</C_0240><C_0250>0</C_0250><C_0260>3499</C_0260><C_0270>0</C_0270><C_0280
/></vehicle>,
<vehicle><C_0010>10</C_0010><C_0160>013</C_0160><C_0170>ADLY</C_0170><C_0180>Vierräder
L5</C_0180><C_FahrzeugLangText>Go-Kart
125</C_FahrzeugLangText><Tueren>0</Tueren><Aenderungs_KZ>X</Aenderungs_KZ><C_0190>5</C_0190><C_0200>0</C_0200><C_0210>125</C_0210><C_220
/><C_0230>0</C_0230><C_0240>040</C_0240><C_0250>0</C_0250><C_0260>3499</C_0260><C_0270>0</C_0270><C_0280
/></vehicle>,
<vehicle><C_0010>10</C_0010><C_0160>014</C_0160><C_0170>ADLY</C_0170><C_0180>Vierräder
L5</C_0180><C_FahrzeugLangText>Go-Kart
125</C_FahrzeugLangText><Tueren>0</Tueren><Aenderungs_KZ>X</Aenderungs_KZ><C_0190>5</C_0190><C_0200>0</C_0200><C_0210>125</C_0210><C_220
/><C_0230>0</C_0230><C_0240>040</C_0240><C_0250>0</C_0250><C_0260>3499</C_0260><C_0270>0</C_0270><C_0280
/></vehicle>

If I bind vehicles to a dataProvider of a DataGrid it looks like at the picture
I attached.  At the moment I don't want to write a method for value extraction
again, because I'm a beginner in XML in Flash. Thats why I ask again if there
is some "nice trick" to convert the XML automatically to an object so it can be
bound directly to a dataProvider. If this is not possible, I would appreciate
for advice, how to get the XML value in the DataGrid.

Greetings
Christoph



flexcoders@yahoogroups.com wrote on 16.11.2005 20:13:59:

> The resultFormat for RemoteObject defaults to "object".  Are you sure
> you do not already have an object in your result?
>
> Use a handler function and inspect the result object in a debugger.
> Often the issue with dataProviders is determining the exact reference
> pointing at the necessary array.  For instance, sometimes you need
> event.result[0].
>
> If you really have a string of xml, you could load it into an XML class
> object and use that as the dataProvider. Currently, referencing the
> correct nodes/attributes in XML is a bit clumsy, but I prefer it to the
> "black-box" conversion of xml to mx:Object that Flex does automatically.
> And unless your data and label properties are top-level attributes of
> the item nodes, you might need to use a label function:
> http://www.cflex.net/showfiledetails.cfm?ObjectID=258
>
> And in Flex 2, the XML class is significantly enhanced.
>
> Tracy
>
> -----Original Message-----
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Wednesday, November 16, 2005 9:58 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] fill ComboBox with XML received by RemoteObject
>
> Hi List,
>
> I tried to fill a ComboBox with XML received by a RemoteObject - with no
> success.
> The result of the RemoteObject is a String in which is XML Content. If I
> create
> a Model by <mx:Model id="my_id" source="my_xml_file" /> and bind the
> ComboBox
> to "my_id" everything works fine.
>
> I searched the web and found a AS class XMLHelper
> http://www.cflex.net/showfiledetails.cfm?ObjectID=243 , but the results
> of this
> classe are not suitable for a ComboBox.
>
> I further searched the web and found how to load dynamically XML using
> HTTPService http://www.cflex.net/showfiledetails.cfm?ObjectID=103
> This seems to be interesting, but I think this only can be used with XML
> files.
>
> Of course it is possible to parse the String received by the
> RemoteObject and
> build a model ( well - I wasn't successful here, too ), but isn't there
> any
> "cheap trick" to do something in Actionscript with a XML String which
> has
> exactly the same result as <mx:Model> with a XML file?
>
> Any help is appreciated.
> Christoph
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<<attachment: xml_dg.jpg>>

Reply via email to