-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is there a way to customize the error box such as left-alignment and nowrap? I'm displaying multiple errors for a field and want the errors left aligned instead of centered.
You can start to play with the following (More you can read in the Developer Reference):
zk.xml
<!-- ====================================================== --> <!-- Path to the own error page --> <!-- ====================================================== --> <error-page> <exception-type>java.lang.Throwable </exception-type> <location>/error.zul</location> </error-page>
.
error.zul
<?xml version="1.0" encoding="UTF-8" ?> <zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd"> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <window title="Error ${requestScope['javax.servlet.error.status_code']}" width="450px" border="normal" mode="modal"> <vbox> <separator /> <separator /> <div sclass="z-messagebox" width="100%"> <label multiline="true" value="${requestScope['javax.servlet.error.message']}" sclass="word-wrap" width="100%" /> </div> <separator /> <hbox style="margin-left:auto; margin-right:auto"> <button label="Continue" onClick="spaceOwner.detach()" /> <button label="Reload" onClick="Executions.sendRedirect(null)" /> </hbox> </vbox> <!-- optional: record the error for improving the app --> <zscript> org.zkoss.util.logging.Log.lookup("Fatal").error( requestScope.get("javax.servlet.error.exception")); </zscript> </window> </zk>
best
Stephan
Hi dorr,
You have to override the showError_() method from InputWidget and then implement your own Errorbox object.
For example,
<zk xmlns:w="http://www.zkoss.org/2005/zk/client"> <textbox constraint="no empty" w:showError_="function(mesg){zk.error(mesg);}"/> </zk>
Is there any document about error box CSS?
I took a look in the official style guide, but I didn't find anything.
Thanks,
Dario
you can utilize the firebug plugin to inspect its CSS rule.
Asked: 2010-05-15 12:32:12 +0800
Seen: 1,088 times
Last updated: Nov 15 '10