Problem with exception being thrown within modal window

asked 2014-10-30 19:32:55 +0800

gsanmartin gravatar image gsanmartin
25 5

The problem I have is pictured in http://zkfiddle.org/sample/d81hea/3-DoModal-wth-Exception (this fiddle) I created:

If you click on the Order coffee button, I've forced a Runtime Exception to be thrown whithin 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?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-02 09:51:31 +0800

Darksu gravatar image Darksu
1991 1 4

Hello gsanmartin,

The best way to prevent it, is to write a well structured code, with a lot of test case scenarios.

p.s You can also disable the pressed button after it is clicked.

Best Regards,


link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2014-10-30 19:32:55 +0800

Seen: 6 times

Last updated: Nov 02 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More