The client-config Element

It is used to customize the behavior of the ZK Client Engine. You might have multiple client-config elements in one zk.xml.

<client-config>
    <debug-js>false</debug-js>    
    <disable-behind-modal>false</disable-behind-modal>    
    <error-reload>    
        <error-code>301</error-code>        
        <reload-uri></reload-uri>        
    </error-reload>    
    <keep-across-visits>true</keep-across-visits>    
    <processing-prompt-delay>900</processing-prompt-delay>    
    <tooltip-delay>800</tooltip-delay>    
    <resend-delay>9000</resend-delay>    
</client-config>

The debug-js Element

[Default: false]

It specifies whether to debug JavaScript files. By default, it is false and the compressed version of JavaScript files will be loaded. They are hard to read and debug, though the footprint is much smaller.

To debug JavaScript files, you can specify it to true. Then, the original uncompressed JavaScript files will be loaded instead.

The disable-behind-modal Element

[Default: false]

It specifies whether to disable all elements behind the modal window at the browser. If disabled, the performance is better.

Tip: This option can be considered as obsolete since 3.0.4. The user is almost impossible to change focus to an element behind the modal window, without disabling them.

Note: in ZK 3.0.3 and earlier, the option is default to true.

The error-reload Element

[Default: reload if 301, 402 or 403; show an error message, otherwise]

It specifies what URI to redirect the browser to. For example, if you prefer to redirect to the login page, say, login.zul, you can specify the following in zk.xml:

<error-reload>
    <error-code>301</error-code>    
    <reload-uri>/login.zul</reload-uri>    
</error-reload>
<error-reload>
    <error-code>402</error-code>    
    <reload-uri>/login.zul</reload-uri>    
</error-reload>
<error-reload>
    <error-code>403</error-code>    
    <reload-uri>/login.zul</reload-uri>    
</error-reload>

If the content of reload-uri is empty, the browser simply reloads the same page again.

<reload-uri></reload-uri>

If you want to show an error message instead, specify false.

<reload-uri>false</reload-uri>

The keep-across-visits Element

[Default: false[8]]

It specifies whether to keep the desktop when a user reloads an URL or browses away to another URL. Since browsers won't cache HTML pages generated by ZK, ZK removes a desktop as soon as the user reloads the URL or browses to another URL.

However, you have to specify keep-across-visits with true, if you use the server-side cache for the HTML pages generated by ZK. An example of the server side cache is OpenSymphony CacheFilter[9].

<client-config>
    <keep-across-visits>true</keep-across-visits>    
</client-config>

The processing-prompt-delay Element

[Default: 900]

It specifies the time, in milliseconds, to wait before prompting the user with a dialog indicating that the request is in processing.

The resend-delay Element

[Default: 9000 if Enterprise Edition[10], -1 otherwise]

It specifies the time, in milliseconds, to wait before resending the AU requests to the server. There are many reasons an AU request is not received by the server. For example, the server may drop the connection if it is overloaded. To ensure the reliability, ZK will abort the previous request and then resend the request, if the specified delay expires.

Since 3.0.3, you can specify a non-positive number to disable the resend mechanism.

The tooltip-delay Element

[Default: 800]

It specifies the time, in milliseconds, to wait before popping up the tooltip when the user moves the mouse pointer over particular UI components.



[8] Exception: the Opera browser.

[10] More precisely, 9000 if zkmax.jar is installed.