The client-config Element"

From Documentation
m
m
Line 22: Line 22:
  
  
=== The click-filter-delay Element ===
+
== The click-filter-delay Element ==
 
[Default: <tt>0</tt>]<br/>
 
[Default: <tt>0</tt>]<br/>
 
Since 3.0.9 and 3.5.3
 
Since 3.0.9 and 3.5.3
Line 31: Line 31:
 
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.
 
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 ===
+
== The debug-js Element ==
 
  [Default: <tt>false</tt>]
 
  [Default: <tt>false</tt>]
  
Line 38: Line 38:
 
To debug JavaScript files, you can specify it to true. Then, the original uncompressed JavaScript files will be loaded instead.
 
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 ===
+
== The disable-behind-modal Element ==
 
  [Default: <tt>false</tt>]
 
  [Default: <tt>false</tt>]
  
Line 47: Line 47:
 
'''Note''': in ZK 3.0.3 and earlier, the option is default to true.
 
'''Note''': in ZK 3.0.3 and earlier, the option is default to true.
  
=== The error-reload Element ===
+
== The error-reload Element ==
 
  [Default: show an error message]
 
  [Default: show an error message]
  
Line 74: Line 74:
 
<blockquote>
 
<blockquote>
  
==== connection-type ====
+
=== connection-type ===
 
  Optional
 
  Optional
 
  Default: au
 
  Default: au
Line 82: Line 82:
  
 
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]]
 
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 ====
+
=== device-type ===
 
  Optional
 
  Optional
 
  Default: ajax
 
  Default: ajax
Line 89: Line 89:
 
Specifies the device type. By default, it is <tt>ajax</tt>. If you want to configure for ZK Mobile, use <tt>mil</tt>.
 
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 ====
+
=== error-code ===
 
  Required
 
  Required
  
Line 105: Line 105:
 
</source>
 
</source>
  
==== reload-uri ====
+
=== reload-uri ===
 
  Required
 
  Required
  
Line 123: Line 123:
 
</blockquote>
 
</blockquote>
  
=== The keep-across-visits Element ===
+
== The keep-across-visits Element ==
  
 
  [Default: <tt>false</tt>]
 
  [Default: <tt>false</tt>]
Line 143: Line 143:
 
<references/>
 
<references/>
  
=== The package Element ===
+
== The package Element ==
 
[Default: <i>none</i>][since 5.0.0]
 
[Default: <i>none</i>][since 5.0.0]
  
Line 161: Line 161:
 
** [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 ]
 
** [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 ===
+
== The processing-prompt-delay Element ==
 
  [Default: 900]
 
  [Default: 900]
  
 
It specifies the time, in milliseconds, to wait before prompting the user with a dialog indicating that the request is in processing.
 
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 ===
+
== The resend-delay Element ==
 
  [Default: 9000 if Enterprise Edition<ref>More precisely, 9000 if zkmax.jar is installed.</ref>, -1 otherwise]
 
  [Default: 9000 if Enterprise Edition<ref>More precisely, 9000 if zkmax.jar is installed.</ref>, -1 otherwise]
  
Line 177: Line 177:
 
<references/>
 
<references/>
  
=== The tooltip-delay Element ===
+
== The tooltip-delay Element ==
 
  [Default: 800]
 
  [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.
 
It specifies the time, in milliseconds, to wait before popping up the tooltip when the user moves the mouse pointer over particular UI components.
  
 +
==Version History==
  
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Revision as of 08:03, 13 July 2010


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>
     <click-filter-delay>0</click-filter-delay>
     <debug-js>false</debug-js>
     <disable-behind-modal>false</disable-behind-modal>
     <error-reload>
         <device-type>ajax</device-type>
         <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 click-filter-delay Element

[Default: 0]
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: 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: 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, login.zul, you can specify the following in zk.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>

connection-type

Optional Default: au [Since 3.6.3]

Specifies the connection type. It can be either au or server-push. By default, it is au 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 server-push as shown in the example below

device-type

Optional Default: ajax [Since 3.6.3]

Specifies the device type. By default, it is ajax. If you want to configure for ZK Mobile, use mil.

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.

<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>

reload-uri

Required

Specifies the URI to reload if the specified error occurs.

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]

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[1].

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

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

The package Element

[Default: none][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 foo.fly.*, then the following shall be specified to enable Ajax-as-a-Service.

<client-config>
	<package>
		<package-name>foo.fly</package-name>
	</package>
</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[1], -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

  1. More precisely, 9000 if zkmax.jar is installed.

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.

Version History


Last Update : 2010/07/13

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.