Customize ZK error message popup

asked 2012-11-14 13:32:22 +0800

xeridia gravatar image xeridia
47 1


In my ZK application, I have a customized error ZUL page, when some error occurs:


With this configuration, I get an error page that is shown with application styling.

My problem is that some interface failures show a message box with ZK default style (and ZK title). This happens, for instance, when SizeLimitExceededException is thrown in too big file upload.
I would like to customize this kind of messages (text and appearance), but I don't find a valid solution.
Does anyone have any ideas?

My tries were:
1. Customize org.zkoss.zk.au.http.AuUploader, overriding handleError method. With this, I only customize error text message, that is not enough.
2. Customize org.zkoss.zul.Messagebox, setting template with setTemplate method on application startup. With this, I customize default messagebox template, but is not used in SizeLimitExceededException error popup.


delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-11-15 04:41:41 +0800

MontyPan gravatar image MontyPan
435 3

Hi xeridia,

The system's exception will handle by error-page setting, but the ZK's exception (like size limit exception of file upload) will handle by ZK itself.
According to your requirement, my suggest is override the jq.alert() method, like this:

	jq.alert = function (msg, opts) {
	<button label="Upload error" upload="true, maxsize=1"/>

Notice: It has global effect with other component which use this function on the same zul.

http://www.zkoss.org/javadoc/6.5.0/jsdoc/_global_/jq.html#alert(_global_.String, _global_.Map)

Monty Pan

link publish delete flag offensive edit
Your reply
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




Asked: 2012-11-14 13:32:22 +0800

Seen: 227 times

Last updated: Nov 15 '12

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