Re: [flexcoders] Re: Updating renderer properties

2010-03-04 Thread Aaron Hardy
I know this is an old thread, but for those who come across this in the future, this is a great article that sums up the problem and solutions quite well: http://www.adobe.com/devnet/flex/articles/itemrenderers_pt3_02.html Aaron On Fri, Jan 8, 2010 at 10:47 PM, Aaron Hardy aaronius...@gmail.com

[flexcoders] Re: Updating renderer properties

2010-01-08 Thread valdhor
I haven't tried this so I have no idea if it would work but why not just create a static variable inside your renderer class and change that as required? --- In flexcoders@yahoogroups.com, Aaron Hardy aaronius...@... wrote: I think there might be a misunderstanding. If it's a transient

[flexcoders] Re: Updating renderer properties

2010-01-08 Thread Amy
--- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote: We're not so off really, I hear what you're saying. Now we're getting a better idea of the use-case. In this case, all of the itemRenderers need to be controlled the same way; by changing their styles and/or labels. So let's

[flexcoders] Re: Updating renderer properties

2010-01-08 Thread valdhor
I set up a quick test bed based on your original post and using a static variable in the renderer(s) and it worked rather well. It may not be what you are after but I will post the example here for others that may want to use this. Application: ?xml version=1.0 encoding=utf-8? mx:Application

Re: [flexcoders] Re: Updating renderer properties

2010-01-08 Thread Aaron Hardy
Thanks for sharing your thoughts and examples. In my case I decided to pass in a model with a property into the renderers. The model is passed into the renderer by specifying it as a property value in the renderer class factory. The model doesn't ever get replaced after that, but the property

[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
One thought, since you're taking about a style, is to assign a styleName to the itemRenderer and update the backgroundColor style of the StyleDeclaration when the user changes the color. You may need to override the styleChanged() method the itemRenderer, to handle the update. -TH --- In

Re: [flexcoders] Re: Updating renderer properties

2010-01-07 Thread Aaron Hardy
Good point. So maybe I have to categorize everything as being data (in which case it hangs out with the data object) or style (in which case it would be applied to all the renderers and can be ran through the various style mechanisms). To be clear, the changes (that aren't data-dependent) being

[flexcoders] Re: Updating renderer properties

2010-01-07 Thread Amy
--- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote: One thought, since you're taking about a style, is to assign a styleName to the itemRenderer and update the backgroundColor style of the StyleDeclaration when the user changes the color. You may need to override the

[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
If it's a pure style, then yes that is a viable approach. However, if it's something like changing text (characters, not styles), then you might want to use [Transient] properties in a VO and/or use states in the itemRenderer. -TH --- In flexcoders@yahoogroups.com, Aaron Hardy aaronius...@...

Re: [flexcoders] Re: Updating renderer properties

2010-01-07 Thread Aaron Hardy
Yes, I suppose the line of what is or is not a style can be blurry at times. In any case, using transient properties inside a VO is what I was eluding in the first item of things I've thought of, the downside being that a model/VO of some type is needed in order to keep the renderer notified of

[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
Sure, but you don't necessarily need a model to use a VO; it can just be the strongly typed object that the dataProvider uses for its items. If you then change the transient properties of that VO, the set data method of the itemRenderer will work out of the box; and you can then adjust the

Re: [flexcoders] Re: Updating renderer properties

2010-01-07 Thread Aaron Hardy
I think there might be a misunderstanding. If it's a transient property on the data objects that come through the data provider, I would have to change the property for all the objects in the data provider to be the same value since I want all the renderers to change in the same way. For

[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
We're not so off really, I hear what you're saying. Now we're getting a better idea of the use-case. In this case, all of the itemRenderers need to be controlled the same way; by changing their styles and/or labels. So let's go up a level. Extend the List, or whatever. Both the