Search code examples
dialogmodal-dialogzk

ZK: Modal window not working properly when exception is thrown


The problem I have is pictured in this fiddle I created:

If you click on the Order coffee button, I've forced a Runtime Exception to be thrown within the doAfterCompose method of the modal window's controller. As you can see the modal window gets appended at the bottom of the page. This, aside from being ugly, allows the user to click again the Order Cofee button, which causes the famous "Not unique ID in space" error.

Is there any way to prevent the window from being created when an Exception is thrown?


Solution

  • You can call setPage(null) method on your component.