John, can you use the XML class? It already IS a dom.  

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Lachlan Cotter
Sent: Sunday, December 03, 2006 11:08 PM
To: [email protected]
Subject: Re: [flexcoders] Class-based model as a dataprovider

 

Hi John,

 

Sorry if I missed the point but I'm not entirely clear on what you're
trying to do here. Do you want to unmarshal your XML into an object
graph of custom classes? I don't understand how the multiple renderers
comes into it. What is the XML describing? Is it a result set or
something less regular?

 

With regard to point 2, I think anything can be a dataProvider if it
implements one of the accepted interfaces. IList, ICollectionView etc.

 

Cheers,

Lach

 

 

On 04/12/2006, at 11:57 AM, John Mazzocchi wrote:





Hi, I need a hand here ...

I have an app which reads an XML file, shoves everything into an
XMLListCollection and then renders the collection to a one-column
datagrid. Each row of the datagrid uses a (state-based)
customItemRenderer [don't get me started on the problems I've had with
ViewStack-based approach].

Anyway, it seems to work fairly well ... but I've now been asked to take
a slightly different approach. The XML needs to be shoved into an Object
Model (a custom DOM), so that the same data can have multiple
renderers/converters created in the future (not just
"renderToScreen")... renderToPDF, renderToCSV, etc. Now there are notes
in the PDF docs on creating a Class-based model ... I figure I'm gonna
create an array of Objects, each one typed as they need to be, you know
Bool, Text, Graphics, customSetOfAttribs, whatever ... custom addItem
and removeItem functions which use templates for each Object type.

1. Any comments on my methodology?

2. How do I assign an ActionScript class as a dataprovider (for a
datagrid)?

Thanks.

Cheers
John

 

 

Reply via email to