|
|
(29 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
− | == The client-config Element ==
| + | {{ZKConfigurationReferencePageHeader}} |
− | It is used to customize the behavior of the ZK Client Engine. You might have multiple <tt>client-config</tt> elements in one <tt>zk.xml</tt>. | + | |
| + | It is used to customize the behavior of ZK Client Engine. You might have multiple <code>client-config</code> elements in one <code>zk.xml</code>. |
| | | |
| <source lang="xml" > | | <source lang="xml" > |
Line 19: |
Line 20: |
| </source> | | </source> |
| | | |
− | | + | {{ZKConfigurationReferenceHeadingToc}} |
− | === The click-filter-delay Element ===
| + | {{ZKConfigurationReferencePageFooter}} |
− | [Default: <tt>0</tt>]<br/>
| |
− | Since 3.0.9 and 3.5.3
| |
− | | |
− | It specifies the time, in milliseconds, to filter out consecutive click events. If two click events (including onOK and onCancel) come too close (within the specified delay), the second one will be removed to avoid the denial-of-service attack.
| |
− | A non-positive value turns off this feature.
| |
− | | |
− | Prior to ZK 3.5.3, it is default to 390, which means it filters out the second click event if it happens within 390 milliseconds.
| |
− | | |
− | === The debug-js Element ===
| |
− | [Default: <tt>false</tt>]
| |
− | | |
− | 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: <tt>false</tt>]
| |
− | | |
− | 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: show an error message]
| |
− | | |
− | It specifies what URI to redirect the browser to. For example, if you prefer to redirect to the login page, say, <tt>login.zul</tt>, you can specify the following in zk.xml:
| |
− | | |
− | | |
− | <source lang="xml" >
| |
− | <error-reload>
| |
− | <device-type>ajax</device-type>
| |
− | <error-code>301</error-code>
| |
− | <reload-uri>/login.zul</reload-uri>
| |
− | </error-reload>
| |
− | <error-reload>
| |
− | <device-type>ajax</device-type>
| |
− | <error-code>402</error-code>
| |
− | <reload-uri>/login.zul</reload-uri>
| |
− | </error-reload>
| |
− | <error-reload>
| |
− | <device-type>ajax</device-type>
| |
− | <error-code>410</error-code>
| |
− | <reload-uri>/timeout.zul</reload-uri>
| |
− | <connection-type>server-push</connection-type>
| |
− | </error-reload>
| |
− | </source>
| |
− | | |
− | <blockquote>
| |
− | | |
− | ==== connection-type ====
| |
− | Optional
| |
− | Default: au
| |
− | [Since 3.6.3]
| |
− | | |
− | Specifies the connection type. It can be either <tt>au</tt> or <tt>server-push</tt>. By default, it is <tt>au</tt> which are the Ajax reqests sent by the widgets running at the client.
| |
− | | |
− | If you want to specify the error page for the server push (comet-based), you have to specify <tt>server-push</tt> as shown in the example [[#error-code | below]]
| |
− | ==== device-type ====
| |
− | Optional
| |
− | Default: ajax
| |
− | [Since 3.6.3]
| |
− | | |
− | Specifies the device type. By default, it is <tt>ajax</tt>. If you want to configure for ZK Mobile, use <tt>mil</tt>.
| |
− | | |
− | ==== error-code ====
| |
− | Required
| |
− | | |
− | Specifies the error code, aka., the server status code; see RFC 2068.
| |
− | | |
− | For server-push (comet-based), there is an important error code called 410. It is received when the session is timeout (or the serve is restarted). If you want to notify user about this, you can specify something similar to the following.
| |
− | | |
− | <source lang="xml">
| |
− | <error-reload>
| |
− | <device-type>ajax</device-type>
| |
− | <error-code>410</error-code>
| |
− | <reload-uri>/timeout.zul</reload-uri>
| |
− | <connection-type>server-push</connection-type>
| |
− | </error-reload>
| |
− | </source>
| |
− | | |
− | ==== reload-uri ====
| |
− | Required
| |
− | | |
− | Specifies the URI to reload if the specified error occurs.
| |
− | | |
− | If the content of <tt>reload-uri</tt> is empty, the browser simply reloads the same page again.
| |
− | | |
− | <source lang="xml" >
| |
− | <reload-uri></reload-uri>
| |
− | </source>
| |
− | | |
− | If you want to show an error message instead, specify <tt>false</tt>.
| |
− | | |
− | <source lang="xml" >
| |
− | <reload-uri>false</reload-uri>
| |
− | </source>
| |
− | </blockquote>
| |
− | | |
− | === The keep-across-visits Element ===
| |
− | | |
− | [Default: <tt>false</tt>]
| |
− | | |
− | 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 <tt>keep-across-visits</tt> with <tt>true</tt>, if you use the server-side cache for the HTML pages generated by ZK. An example of the server side cache is OpenSymphony CacheFilter<ref>[http://www.opensymphony.com/oscache/wiki/CacheFilter.html http://www.opensymphony.com/oscache/wiki/CacheFilter.html] </ref>.
| |
− | | |
− | <source lang="xml" >
| |
− | <client-config>
| |
− | <keep-across-visits>true</keep-across-visits>
| |
− | </client-config>
| |
− | </source>
| |
− | | |
− | '''Note:''' When working with Opera, ZK always keeps the desktop (until the number of desktops exceed the allowed maximal number), since Opera is smart enough to preserve the most updated content and always reuses the cached page.
| |
− | | |
− | | |
− | '''Notes'''
| |
− | <references/>
| |
− | | |
− | === The package Element ===
| |
− | [Default: <i>none</i>][since 5.0.0]
| |
− | | |
− | It defines a client package (JavaScript) and all of its sub packages that are provided by this server. Use this configuration if some client packages might be loaded from different servers, such as Ajax-as-a-Service.
| |
− | | |
− | For example, if this server provides the client packages for <tt>foo.fly.*</tt>, then the following shall be specified to enable Ajax-as-a-Service.
| |
− | | |
− | <source lang="xml">
| |
− | <client-config>
| |
− | <package>
| |
− | <package-name>foo.fly</package-name>
| |
− | </package>
| |
− | </client-config>
| |
− | </source>
| |
− | | |
− | * See Also
| |
− | ** [http://blog.zkoss.org/index.php/2009/08/16/experiment-on-eai-mashup-and-ajax-as-a-service Experiment on EAI, Mashup and Ajax-as-a-Service ]
| |
− | | |
− | === 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<ref>More precisely, 9000 if zkmax.jar is installed.</ref>, -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.
| |
− | | |
− | | |
− | '''Notes'''
| |
− | <references/>
| |
− | | |
− | === 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.
| |
− | | |
− | == See Also ==
| |
− | | |
− | [[Developer reference Appendix B. WEB-INF/zk.xml | WEB-INF/zk.xml]]
| |