The timeout-message Element

From Documentation
Revision as of 14:41, 4 December 2010 by Tomyeh (talk | contribs)


The timeout-message Element


Syntax:

<timeout-message>a_message</timeout-message>
[Optional]
[Since 5.0.5]
[Default: a message defined in MZk.UPDATE_OBSOLETE_PAGE]

It specifies the message to show when the session is timeout. Notice that it is used only if the timeout-uri element is not specified.

<session-config>
	<device-type>ajax</device-type>
	<timeout-message>Session timeout. Please reload.</timeout-timeout>
</session-config>

Internationalization

If you want to specify a Locale-dependent message, you could specify the key and prefix it with label: as follows.

<session-config>
	<device-type>ajax</device-type>
	<timeout-message>label:timeout</timeout-timeout>
</session-config>

Then, you have to prepare the i3-label properties files as described in ZK Developer's Reference.

#i3-label.properties
timeout={
Session timeout.
(multi-line is allowed)
}

JavaScript

Instead of sending the message, you could provide the JavaScript code for the client to evaluate. To specify the JavaScript code, you have to prefix it with script:.

For example, you have a function called foo.timeout to handle the timeout effect, then you could configure WEB-INF/zk.xml as follows.

<session-config>
	<device-type>ajax</device-type>
	<timeout-message>script:foo.timeout('Session Timeout')</timeout-timeout>
</session-config>

The code depends on the client. For Ajax devices, it has to be JavaScript.

Version History

Last Update : 2010/12/04


Version Date Content
5.0.5 October 2010 The support of Custom Message and JavaScript was introduced.



Last Update : 2010/12/04

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