OK, it's all kind of good, but here's what I have discovered. My itemRenderer is a component based on HBox, this is being used as an itemRenderer for a column of a dataGrid. In that component I had 3 Label items. I can create rollover effects for each like so:

<mx:Label id="xx" text="A Link" rollOver="doRoll(xx)" rollOut="doRollOut(xx)" click="doClick(xx)" />

my methods for doRollover and doRollout just change the textField.textColor propery of the label. The problem is they don't respond to the click event. I swapped the Labels out for LinkButtons, and that now responds to the click event, and I can broadcast up to my component containing the dataGrid, retrieve the selected item, etc, etc, and I'm happy. But the LinkButton components don't align correctly and don't get a rollover event, and they get an ugly pushButton effect, etc. So anyone have any ideas about what's going on here? I'd love to have this working much cleaner, and purdier. Thanks!



On Mar 29, 2006, at 2:47 PM, Tobias Patton wrote:

Does your event listener listen for events dispatched by the DataGrid?
Make sure that the event your item renderer dispatches has
"bubbles=true". That way, the DataGrid will dispatch the event after the
renderer dispatches it.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Chris Scott
Sent: Wednesday, March 29, 2006 11:44 AM
To: [email protected]
Subject: [flexcoders] dispatching an event from an itemRenderer

OK, this has been giving me trouble for 2 hours now. Flex 2 Beta 2, 
btw. So I have a component with a dataGrid in it. For one of the 
dataGridColumns I have itemRenderer set to another component, in 
which I have a few text fields. I would like to dispatch an event 
when one of those text fields is clicked, and add an event listener 
for it in the component containing the dataGrid. But this will just 
not happen for me. Does anyone have any examples of doing something 
like this? Imagine hyperlinks in the dataGrid cells. Of course I will 
need to access the data for that cell, but one step at a time, perhaps!


Chris Scott
[EMAIL PROTECTED]
http://cdscott.blogspot.com/
http://www.coldspringframework.org/




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS





Reply via email to