-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, i'm trying to use an event listener to refresh a parent window from onClose event of child window.
This in parent window to open another window:
{
window = (Window)Executions.createComponents(componentFileName, null, requestData);
window.addEventListener("onClose", new EventListener<Event>() {
public void onEvent(Event event) {
System.out.println("SONO NELL'EVENT LISTENER");
refreshListaStazioni();
}
});
window.doModal();
}
in the new page i have:
{
System.out.println("STO CHIUDENDO QUESTA FORM");
Event closeEvent = new Event( "onClose", this.getSelf(), null ) ;
Events.postEvent( closeEvent );
}
i have tried these two methods in two others projects and all works fine, can someone tell what can i try? thanks in advance.
P.S. sorry for my bad english :D
Hi DaniloCaccia,
Could be a few scenario where the event wouldn't reach the outer window, but from your code it looks like you are creating an event with the inner window as target.
I'd say try using new Event("onClose",null,null) since passing a target component will restrict to listeners declared on the same comp. (or new Event("onClose",targetWindow,null) if you have access to the target object.
can you make a zkfiddle sample to review the full class?
Asked: 2019-06-26 18:04:05 +0800
Seen: 17 times
Last updated: Jun 27 '19