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 wrote:
> Thanks for
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
ins
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:
http://www.adobe.com/2006/mxml";
layout="vertical" w
--- In flexcoders@yahoogroups.com, "turbo_vb" 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
> go
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 wrote:
>
> I think there might be a misunderstanding. If it's a transient property on
> the da
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 dataProvider
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 example,
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 rend
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
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 wrote:
>
> Good
--- In flexcoders@yahoogroups.com, "turbo_vb" 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 styleChanged()
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 ma
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 flex
13 matches
Mail list logo