Question

Is there a way to style the validation message (WrongValueException etc.) Because it is absolutly not touch friendly.

I searched in the docs of zk but i found nothing.

Currently I use Zk 6.5.2

Was it helpful?

Solution

The validation messages are displayed in an ErrorBox widget.

The z class is z-errbox. Unfortunately, I don't believe ZK gives you a hook to specify a custom z class for any particular ErrorBox. This means the only way to override the style for an ErrorBox is to override the style for all ErrorBoxes. It sounds like that might work for you, if so, you can see the the ZK style class definitions in the source code.

For example, you could override the validation text color with..

.z-errbox-center {
    color: blue;
}

As a side note, you'll probably want to hook your custom CSS file into ZK rather than manually loading it on the page. This will ensure it gets loaded as fast as possible and the user won't see the styles change as the page loads.

(in WEB-INF/zk.xml)

<desktop-config>
    <theme-uri>/css/style.min.css</theme-uri>
</desktop-config>

You can read more about the theme-uri tag in the documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top