The setter is just an interface into your component property.  How you
implement the functionality is up to you and is unlimited.  You can bind
your property to whatever in the app, and the setter will be called when
the model changes.  The Adobe components implement the dataProvider with
a setter I'm sure.

 

If you pass xml into the component in the dataProvider property it will
not need to be parsed again.  Again, how you respond to the property
change is up to you.  If you are talking about "recycling" your
children, then that is not about the dataprovider, but about your
response to the model change.

 

But if you are on track, then keep going.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Derrick Anderson
Sent: Friday, April 18, 2008 8:02 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] custom component dataprovider

 

Hey Tracy,

I thought of that but it seems to limit me from what I'm trying to do.
I need the UI of this component to respond when the dataprovider
changes, I figured the best way would be to implement a dataprovider the
way the mx components do it, it seems complicated but I'm getting
throught it.  Then if I changed the model, the UI would update
appropriately.  If i just implement the child creation in the setter,
then I have to re-parse the whole dataprovider again, right?  I had
assumed that implementing a dataprovider would make updates to the UI
cleaner (not having to re-create all items), but I could be wrong on
that assumption- don't know yet.

d.

On Fri, Apr 18, 2008 at 5:26 PM, Tracy Spratt <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

Just implement a public setter function on your component that takes
XML.

 

In the setter, launch your child instantiation code.  I have done this
and it  can be a bit complex, but is not hard.

 

Tracy

 

 

 

________________________________

From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Derrick Anderson
Sent: Friday, April 18, 2008 1:16 PM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: [flexcoders] custom component dataprovider

 

hey everyone,

i'm trying to build a custom component based off of a Panel, but the
trick is that I would like the panel to accept xml as a dataprovider.
where are there any good tutorials on building custom components with
dataproviders?

btw, the goal is to take an xml node in the dataprovider (<box x="10"
y="15"><panel title="test panel" /></box>) and convert them to UI
components.  Any ideas?

thanks,
d.

 

 

Reply via email to