Like I said, I'm trying to minimize my time per message and generally give short answers and leave out detail. Sounds like you're on your way and that's great.
Normally, though I don't override data getter/setters in my renderers. I map the data to a type in commitProperties. But there are exceptions to every rule... Nevertheless, I am concerned you haven't fully absorbed the "recipe" and maybe looking at your code will shed some light on it for you and others as there are things you can't do in the setter override that you should only do in commitProperties or later and thus your current recipe may not be cloneable on your next renderer. ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of droponrcll Sent: Sunday, September 30, 2007 9:47 AM To: [email protected] Subject: [flexcoders] Re: MultiPurpose ItemRenderer --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > I'm going to try to combine your other response as well. > > > > Yes, the repeater lets you dictate what the data items are and the same > is true for item renderers. Normally, you plug a collection or array or > xmllist into a List/Tree/DataGrid, etc and the items in that collection > become the data properties in the renderers. > > > > The renderers job is to pull fields from the data object and stuff it > into UI widgets in a renderer. > > > > I'm a codehead, and while I've given many talks about itemrenderers at > MAX and other venues, it is an entire hour presentation and assumes > you're up to speed on object oriented programming and actionscript, and > trying to distill this topic into an email on FlexCoders is outside my > time constraints right now. I generally respond to these emails while > waiting for builds and regression tests to run, and give short answers > when I know others on the forum can fill in the details. > > > > Sounds like you're hitting a pretty straightforward issue dealing with > actionscript. If you post your code, I'll try to take a look at it on > my next pass through this forum (as a true codehead, it is often easier > for me to read code than your description). Also see some code I helped > with in this forum yesterday with the subject "DataGrid cell access > question" OK, thanks. I actually tracked it down that the issue was I changed the data type of the data override function to my own custom object type. The problem is not that I don't understand ActionScript, but that there are so many things to it that I can't keep them all in my head at once as I move forward. And the points at which AS interfaces with MXML make it difficult to understand (as someone new to Flex) where the issue is. To _you_ it might be obvious that your statement to invalidateproperties was self-explanatory, but to me the important part that you didn't mention was "you need to override the data getters and setters to incorporate the desired behaviors." Since the getters and setters actually originated in the files you pointed me at, looking at them was only helpful to the extent that it let me know there _were_ getters and setters for data. The compiler is actually what told me I needed to add the override keyword ;-). So, while clearly this is somewhat an AS issue, it is also somewhat a communications issue, since I am guessing that even someone intimately familiar with AS who was not familiar with how renderers work in MXML and not familiar with the inheritance involved might not have followed you either. Not to be critical, just pointing out how this looks from the perspective of someone just picking up this tool. BTW, the stack overflow was caused by a circular reference I hadn't realized was in there. It's somewhat possible my amateurish earlier efforts might have succeeded without that, and I'd never have learned the proper way to override the data methods. Thanks! Amy

