-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a modal that I create using Executions.createComponents(...). Both the modal and parent each have their own ForwardComposers.
When a user adds a new item to the list in the modal, I'd like to call updateLinks() on the parent.
How can I get a reference to the parent composer from the modal composer?
Thanks!
Or, better yet, when you have the new window returned from Executions.createComponents(...), add an event listener to it. Then, when the new item is created, send an event that has the new item as event data.
Parent Composer:
public void someMethod(...) { ... newWin = (Window)Executions.createComponents(....) ; newWin.addEventListener( "onItemAdded", this ) ; ... } public void onItemAdded(Event evt) { Item = (Item)event.getData() ; // do whatever you need to do with the new Item }
Child Composer:
... Item newItem = new Item() ; // when new item is added Events.postEvent( "onItemAdded", self, newItem ) ; ...
Asked: 2011-11-08 17:03:00 +0800
Seen: 234 times
Last updated: Nov 09 '11