I think it would be a better solution to stop the event bubbling and issue a new event - 'StoreProductEvent' or something.
Then there's no question about how the event should be handled and the intent/purpose of the event is clearly understood, nether would you have to change your final event handling code if you changed the initial product event. Paul ----- Original Message ----- From: "greenfishinwater" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Friday, November 07, 2008 11:00 AM Subject: [flexcoders] Adding data to a bubbling event >I have some view components with are used in a heirarchy: > > Application > Store > Department > Product > > Each component only knows about itself, so the data passed to the > product view only contains product data, and does not contain the > department or store that the product is within. > > When a product is clicked I dispatch a custom event > 'productSelectedEvent' giving the id of the product selected. > > What I also need is to have the department id and the store id, when > the event bubbles up to the application. > > Is it appropriate to have an event listener on 'productSelectedEvent' > in the department view that adds the current department id to the > event, and then similarly in Store add the store id to > 'productSelectedEvent'. > > The event 'productSelectedEvent' has 3 custom properties: > productId > departmentId > storeId > > Thanks Andrew > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > >

