
I’ve posted about this before.
I still have no shame about mediating ItemRenderers and to my happy suprise, Flex 4 makes it simpler with the spark.ItemRenderer and its dataChange event.
Here’s my base prescription in sample form:
Now you and I both know it can be a lot simpler to achieve the same, namely:
Why mediate, it’s so simple? Well the reason is simple too. Things never stay simple. My prescription is a easy template for me to follow, its already second nature for me to do it that way.
The moment I need to mix selection state (or multiple models) into a single renderer, my mediator is there waiting. This includes ensuring that no matter what data source is generating the itemRenderer, I have a templated method for locating the correct model (hence the comment in my mediator above).
© 2010 - VisFleet Ltd
No prawns were harmed in
the making of this website
Comments