LXS
December 16, 2014, 10:39am
1
Hi,
when i want to close a form in dialog i use the following code to do that:
controller.getWindow().hide()
But sometimes - not always - i get this error message:
TypeError: Cannot call method "hide" of null
It seems that ```
controller.getWindow()
Is it better to use ```
application.getWindow().hide()
```?
If yes, what is the difference between this methods?
Thanks,
Alex
LXS
December 18, 2014, 8:32am
2
I can’t believe, that nobody closes forms in dialog
Hi,
I always use a closeWindow() method, somthing like:
function closeWindow($event){
application.getWindow($event.getFormName()).hide();
}
Never any problems hiding/destroying dialogs.
Regards,
Peter
LXS
December 18, 2014, 8:59am
4
Thanks for your reply Peter, but you use application.getWindow() and not controller.getWindow() - right?
LXS:
Thanks for your reply Peter, but you use application.getWindow() and not controller.getWindow() - right?
Yes, that’s right, the event passes the form name.
Regards,
Peter
if controller.getWindow() doesn’t return a window, then that form where that controller belongs to is not in a visible window anymore. (so the window is already hidden or destroyed)