zk 5 configuration reference

Upload: pavan-kumar

Post on 02-Jun-2018

237 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 ZK 5 Configuration Reference

    1/125

    PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information.

    PDF generated at: Mon, 13 Feb 2012 03:13:27 CST

    ZK Configuration ReferenceFor ZK 5

  • 8/10/2019 ZK 5 Configuration Reference

    2/125

    Contents

    Articles

    ZK Configuration Reference 1

    web.xml 1

    ZK Loader 1

    ZK AU Engine 3

    ZK Session Cleaner 5

    ZK Filter 5

    DSP Loader 7

    Sample of web.xml 8

    zk.xml 10

    The client-config Element 11

    The debug-js Element 12

    The disable-behind-modal Element 13

    The error-reload Element 13

    The keep-across-visits Element 15

    The package Element 16

    The processing-prompt-delay Element 17

    The resend-delay Element 17

    The tooltip-delay Element 18

    The desktop-config Element 18

    The desktop-timeout Element 19

    The disable-theme-uri Element 19

    The extendlet-check-period Element 20

    The file-check-period Element 20

    The repeat-uuid Element 21

    The theme-uri Element 21

    The theme-provider-class Element 22

    The device-config Element 23

    The device-class Element 24

    The device-type Element 24

    The embed Element 25

    The server-push-class Element 26

    The unavailable-message Element 27

    The error-page Element 27

    The language-config Element 28

  • 8/10/2019 ZK 5 Configuration Reference

    3/125

    The library-property Element 29

    The Library Properties 30

    class.mold 30

    org.zkoss.util.label.classpath.charset 31

    org.zkoss.util.label.web.charset 31

    org.zkoss.util.label.web.location 32

    org.zkoss.util.logging.config.file 32

    org.zkoss.util.logging.hierarchy.disabled 33

    org.zkoss.util.logging.realCauseBriefly 33

    org.zkoss.web.classWebResource.cache 34

    org.zkoss.web.classWebResource.cache.CSS.hours 34

    org.zkoss.web.classWebResource.cache.etag 35

    org.zkoss.web.util.resource.dir 35

    org.zkoss.web.servlet.http.URLEncoder 36

    org.zkoss.zk.config.path 36

    org.zkoss.zk.scripting.bsh.method.serializable 37

    org.zkoss.zk.ui.composer.autowire.zscript 38

    org.zkoss.zk.ui.composer.autowire.xel 39

    org.zkoss.zk.ui.EmulateIE7 39

    org.zkoss.zk.ui.event.EventQueueProvider.class 40

    org.zkoss.zk.ui.input.grouping.allowed 40

    org.zkoss.zk.ui.macro.autoforward.disabled 41

    org.zkoss.zk.ui.macro.autowire.disabled 41

    org.zkoss.zk.ui.metainfo.page.Loader.class 42

    org.zkoss.zk.ui.uuidRecycle.disabled 43

    org.zkoss.zk.ui.sys.XMLResourcesLocator.class 43

    org.zkoss.zk.WPD.cache 44

    org.zkoss.zkmax.zul.FiledownloadListener.class 44

    org.zkoss.zul.borderlayout.animation.disabed 45 org.zkoss.zul.client.rod 45

    org.zkoss.zul.include.mode 46

    org.zkoss.zul.grid.autoSort 46

    org.zkoss.zul.grid.preloadSize 47

    org.zkoss.zul.grid.initRodSize 48

    org.zkoss.zul.listbox.checkmarkDeselectOthers 48

    org.zkoss.zul.listbox.rightSelect 49

    org.zkoss.zul.listbox.groupSelect 50

    org.zkoss.zul.listbox.autoSort 50

  • 8/10/2019 ZK 5 Configuration Reference

    4/125

    org.zkoss.zul.listbox.preloadSize 51

    org.zkoss.zul.listbox.initRodSize 52

    org.zkoss.zul.numberFormat 52

    org.zkoss.zul.progressbox.position 53

    org.zkoss.zul.theme.browserDefault 54

    org.zkoss.zul.theme.fontFamilyC 54

    org.zkoss.zul.theme.fontFamilytT 54

    org.zkoss.zul.theme.fontSizeM 55

    org.zkoss.zul.theme.fontSizeMS 55

    org.zkoss.zul.theme.fontSizeS 55

    org.zkoss.zul.theme.fontSizeXS 56

    org.zkoss.zul.tree.checkmarkDeselectOthers 56

    org.zkoss.zul.tree.rightSelect 57

    org.zkoss.zul.tree.autoSort 57

    The listener Element 58

    The org.zkoss.zk.ui.event.EventThreadCleanup interface 58

    The org.zkoss.zk.ui.event.EventThreadInit Interface 59

    The org.zkoss.zk.ui.event.EventThreadResume interface 60

    The org.zkoss.zk.ui.event.EventThreadSuspend interface 61

    The org.zkoss.zk.ui.util.Composer interface 61

    The org.zkoss.zk.ui.util.DesktopCleanup interface 62

    The org.zkoss.zk.ui.util.DesktopInit interface 63

    The org.zkoss.zk.ui.util.EventInterceptor interface 63

    The org.zkoss.zk.ui.util.ExecutionCleanup interface 64

    The org.zkoss.zk.ui.util.ExecutionInit interface 64

    The org.zkoss.zk.ui.util.Initiator interface 65

    The org.zkoss.zk.ui.util.Monitor interface 66

    The org.zkoss.zk.ui.util.PerformanceMeter interface 66

    The org.zkoss.zk.ui.util.RequestInterceptor interface 67 The org.zkoss.zk.ui.util.SessionCleanup interface 68

    The org.zkoss.zk.ui.util.SessionInit interface 68

    The org.zkoss.zk.ui.util.UiLifeCycle interface 69

    The org.zkoss.zk.ui.util.URIInterceptor interface 69

    The org.zkoss.zk.ui.util.WebAppCleanup interface 70

    The org.zkoss.zk.ui.util.WebAppInit interface 70

    The org.zkoss.zk.ui.sys.PropertiesRenderer interface 71

    The org.zkoss.zk.ui.sys.SEORenderer interface 72

    The org.zkoss.xel.VariableResolver Interface 73

  • 8/10/2019 ZK 5 Configuration Reference

    5/125

    The log Element 74

    The preference Element 74

    The Preferences 75

    org.zkoss.zk.ui.WebApp.name 76

    The richlet Element 77

    The richlet-mapping Element 78

    The xel-config Element 79

    The session-config Element 80

    The automatic-timeout Element 80

    The device-type Element 81

    The max-desktops-per-session Element 82

    The max-pushes-per-session Element 82

    The max-requests-per-session Element 83

    The session-timeout Element 83

    The timeout-message Element 84

    The timeout-uri Element 85

    The timer-keep-alive Element 86

    The system-config Element 87

    The au-decoder-class Element 88

    The au-writer-class Element 89

    The cache-provider-class Element 90

    The config-parser-class Element 91

    The crawlable Element 91

    The disable-event-thread Element 92

    The disable-zscript Element 92

    The engine-class Element 93

    The event-time-warning Element 94

    The failover-manager-class Element 94

    The file-size-threshold Element 95 The id-generator-class Element 95

    The label-location Element 96

    The max-spare-threads Element 97

    The max-suspended-threads Element 97

    The max-upload-size Element 98

    The max-process-time Element 98

    The response-charset Element 99

    The session-cache-class Element 99

    The upload-charset Element 100

  • 8/10/2019 ZK 5 Configuration Reference

    6/125

    The upload-charset-finder-class Element 100

    The ui-factory-class Element 101

    The web-app-class Element 102

    The web-app-factory-class Element 103

    The system-property Element 104

    The zscript-config Element 104

    JAR File's config.xml 105

    Samples 106

    The client-config Element 107

    The config-name Element 107

    The depends Element 108

    The device-config Element 108

    The language-config Element 109

    The library-property Element 110

    The listener Element 110

    The preference Element 111

    The system-config Element 111

    The version Element 112

    The zscript-config Element 113

    ReferencesArticle Sources and Contributors 114

    Image Sources, Licenses and Contributors 119

  • 8/10/2019 ZK 5 Configuration Reference

    7/125

    ZK Configuration Reference 1

    ZK Configuration Reference

    Documentation:Books/ZK_Configuration_Reference

    If you have any feedback regarding this book, please leave it here.

    http://books.zkoss.org/wiki/ZK_Configuration_Reference

    web.xml

    To add ZK a Web application, you have to add servlets, listeners and an optional filter to web.xml.

    ZK Loader

    DHtmlLayoutServlet

    Location: WEB-INF/web.xml

    [Required] Class: DHtmlLayoutServlet[1]

    ZK Loader is a servlet used to load ZUML pages when the Web server receives URL requests sent by the users.

    Notice that you must specify load-on-startup since many other servlets depend on the ZK loader.

    1

    Here is a complete sample.

    The Initial Parameters

    init-param Descriptions

    update-uri [Required]

    It specifies the URI which the ZK AU engine is mapped to.

    For example, if the ZK AU engine is mapped to /zkau/*, by the use of servlet-mapping, then specify /zkau for this

    parameter.

    Note: if the servlet container is used with other Web server, like Apache, you have to map this update URI to the servlet container (in

    additions to zul and zhtml files).

    compress [Optional][Default:true]

    It specifies whether to compress the output if the browser supports the compression (Accept-Encoding) and this Servlet is not

    included by other Servlets.

    log-level [Optional]

    It specifies the default log level for org.zkoss. If not specified, the system default (usually INFO) is used.

    Possible values: OFF, ERROR, WARNING, INFO, DEBUG and FINER. Please refer to ZK Developer's Reference for details.

    http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Supporting_Utilities/Loggerhttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/http/DHtmlLayoutServlet.html#http://books.zkoss.org/wiki/ZK_Configuration_Reference
  • 8/10/2019 ZK 5 Configuration Reference

    8/125

    ZK Loader 2

    Map URL to ZUML pages

    It is suggested to map this servlet to the zul and zhtml extensions as shown below to process ZUML pages. It is

    OK if you want to prefer to use xul and html as the extension; just map them to ZK Loader too.

    ZK loader for evaluating ZUML pages

    zkLoader

    org.zkoss.zk.ui.http.DHtmlLayoutServlet

    update-uri

    /zkau

    1

    zkLoader *.zul

    zkLoader

    *.zhtml

    Here is a complete sample.

    Map URL to RichletsAssume you have a richlet named foo.FooRichlet. Then, you could configure it as follows.

    First, declare the richlet:

    Foo

    foo.FooRichlet

    Second, map the richlet to any number of URL you want:

    Foo

    /foo

    Fest

    /some/more/*

    Notice that, by default, richlets are disabled. To enable them, add the following declaration to web.xml. Once

    enabled, you can add as many as richlets as you want without modifying web.xml any more. Of course, url-patterncould be any pattern you prefer.

    http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/UI_Composing/Richlet
  • 8/10/2019 ZK 5 Configuration Reference

    9/125

    ZK Loader 3

    zkLoader

    /zk/*

    Then, you can visit http://localhost:8080/PROJECT_NAME/zk/foo[2]

    to request the richlet.

    The URL specified in the url-pattern element must start with /. If the URI ends with /*, then it is matched to

    all request with the same prefix. To retrieve the request's actual URL, you can check the value returned by the

    Page.getRequestPath[3]

    .

    Version History

    Version Date Content

    References[1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/http/DHtmlLayoutServlet.html#

    [2] http:/ /localhost:8080/PROJECT_NAME/zk/test

    [3] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Page.html#getRequestPath

    ZK AU Engine

    DHtmlUpdateServlet

    [Required] Class: DHtmlUpdateServlet

    [1]

    ZK AU Engine, aka., ZK Update Engine, is a servlet that handles AJAX requests asynchronously and automatically.

    Notice that the URL pattern mapped to this engine must be consistent with the update-uri parameter of ZK

    Loader.

    Here is a complete sample.

    The Initial Parameters

    init-param Descriptions

    compress [Optional][Default:true][since 3.6.3]

    It specifies whether to compress the output of this Servlet, if the browser supports the compression (Accept-Encoding). Notice that

    it affects no only the AU response, but also JavaScript and CSS files loaded from this Servlet.

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/au/http/DHtmlUpdateServlet.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Page.html#getRequestPathhttp://localhost:8080/PROJECT_NAME/zk/testhttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/http/DHtmlLayoutServlet.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Page.html#getRequestPathhttp://localhost:8080/PROJECT_NAME/zk/testhttp://localhost:8080/PROJECT_NAME/zk/foo
  • 8/10/2019 ZK 5 Configuration Reference

    10/125

    ZK AU Engine 4

    extension0

    extension1

    extension2

    ...

    [Optional] [since 5.0]

    It specifies an AU extension The first processor must be specified with the name called extension0, second extension1 and so

    on.

    The syntax of the value is

    /prefix=class

    For example,

    extension0

    /upload=com.super.MyUploader

    extension1

    /extra=com.super.MyExtra

    The class must implement the AuExtension[2]

    interface.

    Map URL to ZK AU Engine

    Mapping URL to ZK AU Engine is straightforward:

    auEngine

    org.zkoss.zk.au.http.DHtmlUpdateServlet

    auEngine

    /zkau/*

    Notice that the URL pattern mapped to this engine must be consistent with the update-uri parameter of ZK

    Loader.

    Here is a complete sample.

    Version History

    Version Date Content

    5.0.0 07/14/10 processor0, processor1, processor2 parameters have been depreciated.

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/au/http/DHtmlUpdateServlet.html#

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/au/http/AuExtension.html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/au/http/AuExtension.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/au/http/DHtmlUpdateServlet.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/au/http/AuExtension.html#
  • 8/10/2019 ZK 5 Configuration Reference

    11/125

    ZK Session Cleaner 5

    ZK Session Cleaner

    HttpSessionListener

    [Required] Class: HttpSessionListener[1]

    ZK Session Cleaner is a listener used to clean up memory when a HTTP session is destroyed.

    If you are using Servlet 2.3, please use HttpSessionListener23[2]

    instead.

    ZK listener for cleanup when a session is destroyed

  • 8/10/2019 ZK 5 Configuration Reference

    12/125

    ZK Filter 6

    init-param Descriptions

    extension [Optional][Default: html]

    It specifies how to process the response generated by other servlets.

    If html or zhtml, XHTML is assumed to be the default namespace. If xul or zul, XUL is assumed to be the default namespace.

    charset [Optional][Default: UTF-8]

    It specifies the default charset for the output of this filter.

    If an empty string is specified as follows, the container's default is used. In other words, the setCharacterEncoding method of

    javax.servlet.ServletResponse is not called.

    compress [Optional][Default: true]

    It specifies whether to compress the output if the browser supports the compression (Accept-Encoding) and this filter is not

    included by other Servlets.

    Map URL to ZK FilterZK Filter can be mapped to any servlet or JSP page you want. For example,

    zkFilter

    org.zkoss.zk.ui.http.DHtmlLayoutFilter

    zkFilter

    /foo/whatever.jsp

    zkFilter

    /foo2/*

    Version History

    Version Date Content

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/http/DHtmlLayoutFilter.html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/http/DHtmlLayoutFilter.html#
  • 8/10/2019 ZK 5 Configuration Reference

    13/125

    DSP Loader 7

    DSP Loader

    InterpreterServlet

    [Optional] Class: InterpreterServlet[1]

    DSP Loader is a servlet used to process the DSP files. DSP is a JSP-like template technology.

    It is optional. You need to specify it only if you have DSP pages in your Web application.

    It takes the same syntax as that of JSP. Unlike JSP, DSP is interpreted at the run time, so it is easy to deploy DSP

    pages. No Java compiler is required in your run-time environment. In addition, you could distribute DSP pages in jar

    files. This is the way ZK is distributed.

    However, you cannot embed Java codes in DSP pages. Actions of DSP, though extensible through TLD files, are

    different from JSP tags.

    The Initial Parameters

    init-param Descriptions

    charset [Optional][Default: UTF-8]

    It specifies the default charset for the output of the DSP interpreter.

    If an empty string is specified as follows, the container's default is used. In other words, the setCharacterEncoding method

    ofjavax.servlet.ServletResponse is not called.

    class-resource [Optional][Default: false]

    Specifies whether to load resources, such as TLD files, from the class loader, in addition to the servlet context.

    compress [Optional][Default: true]

    It specifies whether to compress the output if the browser supports the compression (Accept-Encoding) and this Servlet is not

    included by other Servlets.

    Map URL to DSP Loader

    Notice it is optional. You need to specify it only if you want to use DSP pages (*.dsp) in your Web application.

    zkLoader

    org.zkoss.web.servlet.dsp.InterpreterServlet

    dspLoader

    *.dsp

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/web/servlet/dsp/InterpreterServlet.html#
  • 8/10/2019 ZK 5 Configuration Reference

    14/125

    DSP Loader 8

    Version History

    Version Date Content

    References[1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/web/servlet/dsp/InterpreterServlet.html#

    Sample of web.xml

    ZK listener for cleanup when a session is destroyed

    update-uri

    /zkau

    1

    zkLoader

    *.zul

    zkLoader

    *.zhtml

    The asynchronous update engine for ZK

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/web/servlet/dsp/InterpreterServlet.html#
  • 8/10/2019 ZK 5 Configuration Reference

    15/125

    Sample of web.xml 9

    auEngine

    org.zkoss.zk.au.http.DHtmlUpdateServlet

    auEngine

    /zkau/*

    gif

    image/gif

    html text/html

    htm

    text/html

    jad

    text/vnd.sun.j2me.app-descriptor

    jpeg

    image/jpeg

    jpg

    image/jpeg

    js application/x-javascript

    png

    image/png

    txt

    text/plain

  • 8/10/2019 ZK 5 Configuration Reference

    16/125

    Sample of web.xml 10

    xml

    text/xml

    zhtml

    text/html

    zul

    text/html

    index.zul

    index.zhtml

    index.html

    index.htm

    Version History

    Version Date Content

    zk.xml

    WEB-INF/zk.xml is the configuration descriptor of ZK. This file optional. If you need to configure ZK differently

    from the default, you could provide a file called zk.xml under the WEB-INF directory.

    The root element must be . Then, you could specify any combination of the following element under the root

    element.

    File Location

    You can place zk.xml in either a WAR file or a JAR file.

    WEB-INF/zk.xml

    zk.xml is usually packed with a Web application and it should be located under WEB-INF.

    metainfo/zk/zk.xml

    [since 3.6.0]

    For library providers, zk.xml is better to pack with a JAR file. This can be done by placing zk.xml in the metainfo/zk

    directory identifiable by the classpath (i.e., in a JAR file).

    Additonal Configuration File

    [since 5.0.7]

  • 8/10/2019 ZK 5 Configuration Reference

    17/125

    zk.xml 11

    In addition, you could specify an additional configuration file in a library or system property called

    org.zkoss.zk.config.path . It is useful if some of the configuration can not be part of the WAR file (such as

    depending on the deployment environment). For more information, please refer to this section.

    Notice that zk.xml found in the classpath is parsed first, then WEB-INF/zk.xml, and finally the additional

    configuration file. It means the additional configuration file, if any, has the highest priority, and WEB-INF/zk.xml

    (since the later will overrides the previous one if conflicts).

    The client-config Element

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

    one zk.xml.

    0

    false

    false

    ajax

    301

    true

    900

    800

    9000

  • 8/10/2019 ZK 5 Configuration Reference

    18/125

    The debug-js Element 12

    The debug-js Element

    Syntax:

    true|false

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

    Version History

    Version Date Content

    http://books.zkoss.org/index.php?title=File:ZK_Configuration_Reference-debug-js.png
  • 8/10/2019 ZK 5 Configuration Reference

    19/125

    The disable-behind-modal Element 13

    The disable-behind-modal Element

    Syntax:

    true|false

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

    Version History

    Version Date Content

    The error-reload Element

    Syntax:

    [deviceType|ajax]

    an_error_code

    an_uri

    [server-push|au]

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

    ajax

    301

    /login.zul

    ajax

    402

    /login.zul

    ajax

    410

  • 8/10/2019 ZK 5 Configuration Reference

    20/125

    The error-reload Element 14

    /timeout.zul

    server-push

    connection-type

    Optional

    Default: au

    Allowed: au, server-push

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

    ajax

    410

    /timeout.zul

    server-push

    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.

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

    false

  • 8/10/2019 ZK 5 Configuration Reference

    21/125

    The error-reload Element 15

    Version History

    Version Date Content

    The keep-across-visits ElementSyntax:

    true|false

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

    .

    true

    Notes:

    You rarely need to turn on this option, since the HTML page will be reloaded by the browser. It is meaningless

    not to remove the desktop at the server, unless

    1. You apply a special mechanism to cache the generated HTML pages, such as OpenSymphony describedabove.

    2. You turn on the cacheable flag with the page directive

    Don't turn on this option, if you reuse the desktops by use of DesktopRecycle[2]

    . After all, a desktop can be

    reused only if it has been removed (and turning on this option makes a desktop stays alive).

    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.

    Version History

    Version Date Content

    References

    [1] http:/ /www.opensymphony. com/oscache/wiki/CacheFilter.html

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/DesktopRecycle.html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/DesktopRecycle.html#http://www.opensymphony.com/oscache/wiki/CacheFilter.htmlhttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/DesktopRecycle.html#http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Performance_Tips/Reuse_Desktopshttp://books.zkoss.org/index.php?title=ZUML_Reference/ZUML/Processing_Instructions/pagehttp://www.opensymphony.com/oscache/wiki/CacheFilter.html
  • 8/10/2019 ZK 5 Configuration Reference

    22/125

    The package Element 16

    The package Element

    Syntax:

    a_JS_package_name

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

    foo.fly

    See Also

    Experiment on EAI, Mashup and Ajax-as-a-Service[1]

    Version History

    Version Date Content

    References

    [1] http:/ /blog.zkoss. org/index. php/2009/08/16/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-servicehttp://blog.zkoss.org/index.php/2009/08/16/experiment-on-eai-mashup-and-ajax-as-a-service
  • 8/10/2019 ZK 5 Configuration Reference

    23/125

    The processing-prompt-delay Element 17

    The processing-prompt-delay Element

    Syntax:

    a_number

    [Default: 900]

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

    processing.

    Version History

    Version Date Content

    The resend-delay Element

    Syntax:

    a_number

    [Default: -1[1]

    ]

    It specifies the time, in milliseconds, to wait before resending the AU requests to the server. There are a couple of

    reasons an AU request is not received by the server. For example, though rarely, Internet Explorer 6 sometimes won't

    send the package at all. To ensure the reliability, ZK will abort the previous request and then resend the request, if

    the specified delay expires.

    [1] The default is 9000 if ZK 5.0.3 EE or prior is used.

    Version Date Content

    5.0.4 July, 2010 resend-delay is default to -1 (i.e., disabled by default) no matter ZK CE or EE.

    6.0.0 November,

    2011

    The feature is removed and the setting has no effect, since we can't replicate IE6 issue anymore (after using a more

    conservative approach to send an Ajax request)

  • 8/10/2019 ZK 5 Configuration Reference

    24/125

    The tooltip-delay Element 18

    The tooltip-delay Element

    Syntax:

    a_number

    [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

    Version Date Content

    The desktop-config Element

    It is used to customize how ZK handles desktops. You might have multiple desktop-config elements in one

    zk.xml.

    3600

    ~./zul/css/zk.wcs

    5

    10

    /my/blue**.css

    my.MyThemeProvider

  • 8/10/2019 ZK 5 Configuration Reference

    25/125

    The desktop-timeout Element 19

    The desktop-timeout Element

    Syntax:

    a_number

    [Default: 3600]

    It specifies the time, in seconds, between client requests before a desktop is invalidated. A negative time indicates

    the desktop should never timeout.

    Version History

    Version Date Content

    The disable-theme-uri Element

    Syntax:

    a_theme_uri

    [Default: none]

    It specifies what theme URI needs to be disabled. The URI should be one of the URIs generated by the current

    theme. For example, the following statement disables the generation of the URIs of the default theme (since it has

    only one URI: ~./zul/css/zk.wcs).

    ~./zul/css/zk.wcs

    You rarely need it. Rather, implementing a theme provider is a more controllable alternative.

    It is usually used with the theme-uri element to replace the default theme. Please refer to ZK Developer's

    Reference for more details about theming and styling.

    Version History

    Version Date Content

    http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Theming_and_Styling/Theme_Customizationhttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Theming_and_Styling/Theme_Customizationhttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Theming_and_Styling/Theme_Providers
  • 8/10/2019 ZK 5 Configuration Reference

    26/125

    The extendlet-check-period Element 20

    The extendlet-check-period Element

    Syntax:

    a_number

    [Default: -1 (never expired)]

    It specifies the time, in seconds, to wait before checking whether a resource loaded by an extendlet is modified. An

    extendlet is a processor to load the resources which are usually located in classpath, such as

    ~./zul/desktop.dsp .

    Resources located in classpath are usually packed as a JAR file, so they are immutable and not need to check if

    modified. However, in a development environment, you might still want to check out if they are deployed without

    reloading the JAR files.

    Version HistoryVersion Date Content

    The file-check-period Element

    Syntax:

    a_number

    [Default: 5]

    It specifies the time, in seconds, to wait before checking whether a file is modified. For better performance, ZK has

    employed a cache to store the parsed ZUML file. The time specified here controls how often ZK checks whether a

    file is modified. The larger the number the better the performance.

    Version History

    Version Date Content

  • 8/10/2019 ZK 5 Configuration Reference

    27/125

    The repeat-uuid Element 21

    The repeat-uuid Element

    Syntax:

    true|false

    [Default: false]

    [Since 3.6.0]

    It specifies whether to use the same UUID sequence for desktops for each reboot. By default, it is turned off so the

    desktop's UUID is completely different after reboot. It helps to avoid the consistency between the browser and the

    server. However, it is useful to turn this option on if you want to debug and test the application.

    Version History

    Version Date Content

    The theme-uri Element

    Syntax:

    a_theme_uri

    [Default: none]

    It specifies the URI of an addition theme (aka., a style sheet file).

    Like other URI, it accepts "*" for loading browser and Locale dependent style sheet. Please refer to ZK Developer's

    Reference for more details.

    You can specify any number of them-uri as follows.

    /my/blue**.css

    /my/second.css

    If you want to replace a default theme, you have to use theme-uri with disable-theme-uri . Please refer to

    ZK Developer's Reference for more information.

    Notice:

    1. All style sheets defined in lang.xml and lang-addon.xml are loaded, no matter this parameter is defined

    or not. It is convenient for developers to override certain styles.

    2. Each JAR could specify alang-addon.xml file (under the metainfo/zk directory), so you could specify

    style sheets there if you have more than one style sheets.

    3. You could specify extra CSS files for individual ZUML pages by the use of the style component.

    http://books.zkoss.org/index.php?title=ZK_Component_Reference/Essential_Components/Stylehttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Theming_and_Stylinghttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Internationalization/Locale-Dependent_Resourceshttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Internationalization/Locale-Dependent_Resources
  • 8/10/2019 ZK 5 Configuration Reference

    28/125

    The theme-uri Element 22

    Version History

    Version Date Content

    The theme-provider-class ElementSyntax:

    a_class_name

    [Default: none]

    It specifies the class to provide the theme (aka., a style sheet file) URI dynamically if you want to determine the

    theme based on the current user, cookie or locale. You can implement a class with the ThemeProvider[1]

    interface,

    and specify it with the theme-provider-class element. Then, an instance of the class will be created. It will

    be called each time when a desktop is rendered to the client to determine the theme URI.

    Notice that the theme provider is called with all theme URIs that shall be generated (including what are specified in

    theme-uri and excluding what are specified in disable-theme-uri). And, only the return collection of URIs

    are actually generated. In other words, the theme provider has the highest priority.

    For more information, please refer to ZK Developer's Reference.

    Version History

    Version Date Content

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/ThemeProvider. html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/ThemeProvider.html#http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Theming_and_Styling/Theme_Providershttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/ThemeProvider.html#
  • 8/10/2019 ZK 5 Configuration Reference

    29/125

    The device-config Element 23

    The device-config Element

    It specifies a device. A device represents a client. Different clients have different implementation. Currently there are

    two types: ajax and mil. They represent the Web browsers with Ajax, and the mobile device with Mobile

    Interactive Language[1]

    . It is used to create an instance returned by the getDevice method of the Desktop

    intereface.

    The allowed child element is device-type , device-class, timeout-uri, and

    unavailable-message. You might have multiple device-config elements in one zk.xml.

    ajax

    my.MyAjaxDevice

    /my-timeout.zul

    my.ServerPush

    Sorry, JavaScript must be enabled in order for you to use KillApp. ]]>

    AU_progressbar = function (id, msg) {

    Boot_progressbox(id, msg, 0, 0, true, true);

    };

    ]]>

    Note: Unlike most other configurations defined in WEB-INF/zk.xml , the definitions defined in

    device-config are applied to all Web applications sharing the same zk.jar. Refer to the

    zscript-config element for more information.

    Notes

    [1] MIL is a ZK markup language used to communicate with the mobile devices.

  • 8/10/2019 ZK 5 Configuration Reference

    30/125

    The device-class Element 24

    The device-class Element

    Syntax:

    a_class_name

    [Optional]

    It specifies the implementation class. The class must implement the Device[1]

    interface. Instead of implementing it

    from scratch, you can derive from the proper implementation, such as AjaxDevice[2]

    .

    ajax

    my.MyAjaxDevice

    Version History

    Version Date Content

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/device/Device.html#

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/device/AjaxDevice.html#

    The device-type ElementSyntax:

    a_device_type|ajax

    [Required]

    It specifies the device type which the accompany elements will be applied to. The previous implementation with the

    same device type will be replaced if any.

    ajax

    my.MyAjaxDevice

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/device/AjaxDevice.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/device/Device.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/device/AjaxDevice.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/device/Device.html#
  • 8/10/2019 ZK 5 Configuration Reference

    31/125

    The device-type Element 25

    Version History

    Version Date Content

    The embed ElementSyntax:

    any_valid_fragment

    [Optional][Multiple]

    It specifies the content that shall be added to the output generated and sent to the client when rendering a desktop.

    The syntax of the content will depend on the client. For Ajax clients, it can be any tags that can be placed inside

    HTML HEAD tag, such as SCRIPT, META and others.

    For example, if you want to show the progress bar in the center of the browser window, you can specify the

    following in zk.xml.

    ajax

    AU_progressbar = function (id, msg) {

    Boot_progressbox(id, msg, 0, 0, true, true);

    };

    ]]>

    You can specify multiple embed elements and their content be concatenated together.

    Version History

    Version Date Content

  • 8/10/2019 ZK 5 Configuration Reference

    32/125

    The server-push-class Element 26

    The server-push-class Element

    Syntax:

    a_class_name

    [Optional][Default: depends on device and what edition you use]

    It specifies which class used to implement the server-push feature. The class must have a default constructor

    (without any argument), and implement the ServerPush[1]

    interface.

    ajax

    my.ServerPush

    In addition to configuring the application's default implementation, you can choose an implement for a particular

    class by the use of DesktopCtrl.enableServerPush(org.zkoss.zk.ui.sys.ServerPush)[2]

    . For example,

    ((DesktopCtrl)desktop).enableServerPush(new

    org.zkoss.zk.ui.impl.PollingServerPush());

    Version History

    Version Date Content

    References[1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/sys/ServerPush.html#

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/sys/DesktopCtrl.html#enableServerPush(org. zkoss.zk.ui.sys.ServerPush)

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/sys/DesktopCtrl.html#enableServerPush(org.zkoss.zk.ui.sys.ServerPush)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/sys/ServerPush.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/sys/DesktopCtrl.html#enableServerPush(org.zkoss.zk.ui.sys.ServerPush)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/sys/ServerPush.html#
  • 8/10/2019 ZK 5 Configuration Reference

    33/125

    The unavailable-message Element 27

    The unavailable-message Element

    Syntax:

    any_valid_fragment

    [Optional][Default: depends on device]

    It specifies the message that will be displayed if the client doesn't support this device.

    ajax

    Sorry, JavaScript must be enabled in order for you to use KillApp.

    Version History

    Version Date Content

    The error-page Element

    Syntax:

    a_device_type|ajax

    a_class_name

    a_uri

    It specifies an error page used when an un-caught exception is thrown in updating a ZUML page (e.g., in an event

    listener). Each page is associated with an exception type, aka, a class deriving from java.lang.Throwable .

    You can specify multiple error pages, each with a different exception type. When an error occurs, ZK searches the

    proper error page by examing the exception type one-by-one. If none is found, it will show an alert message at the

    client by default.

    The device-type element is optional. If omitted, ajax is assumed.

    For example,

    java.lang.Throwable

    /WEB-INF/sys/error.zul

    For more information, please refer to ZK Developer's Reference: Error Handling.

    http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/UI_Patterns/Error_Handling
  • 8/10/2019 ZK 5 Configuration Reference

    34/125

    The error-page Element 28

    Version History

    Version Date Content

    The language-config ElementSyntax:

    a_uri

    a_uri

    The allowed child elements include addon-uri. You might have multiple language-config elements in one

    zk.xml.

    /WEB-INF/lang-addon.xml

    /WEB-INF/lang-addon2.xml

    Note: Unlike most other configurations defined in WEB-INF/zk.xml, the definitions defined in the language

    addons are applied to all Web applications sharing the same zk.jar.

    In other words, the definitions in the language addons are visible to all Web applications sharing the same zk.jar.

    Furthermore, it may cause errors in another Web application, if the classes or resources are available only in the Web

    application defining this.

    Thus, if this has become an issue, you can just put zk.jar and relevant ZK libraries under the WEB-INF/lib

    directory.

    The addon-uri Element

    [Default: none]

    It specifies the URI of language add-on definitions. To specify more than one URIs, you have to define them with

    multiple addon-uri.

    A language addon is used to add new components and override the definitions of existent components. For more

    information, please refer to ZK Client-side Reference: Language Definition.

    For example,

    /WEB-INF/lang-addon.xml

    Then, the content of lang-addon.xml could be

    FooApplication

    xul/html

    http://books.zkoss.org/index.php?title=ZK_Client-side_Reference/Language_Definition
  • 8/10/2019 ZK 5 Configuration Reference

    35/125

    The language-config Element 29

    The language-uri Element

    [Default: none]

    [since 5.0.7]

    It specifies the URI of the language definition. To specify more than one URIs, you have to define them with

    multiplelanguage-uri

    .A language definition is used to define a new set of components. For more information, please refer to ZK

    Client-side Reference: Language Definition.

    Version History

    Version Date Content

    5.0.7 May 2011 The language-uri element was introduced.

    The library-property Element

    Syntax:

    any name

    any value

    Species a library-level property with the library-property element. The above example is equivalent to

    org.zkoss.lang.Library.setProperty("any name","any value");

    The library properties are shared by all Java codes that use the same set of ZK libraries. If you installed ZK libraries

    in WEB-INF/ib of a ZK application, the library properties can only be shared within the application.

    The library properties are easier to access than preferences since they are static members (of Library[1]

    ). However,

    their scope depends on the installation. If you copy zcommon.jar to a folder that are shared by all applications, then

    the library properties are shared by all applications. If you copy it to WEB-INF/lib for a particular application, then

    the scope is limited to the application.

    For a list of supported library properties, please take a look at Library Properties.

    Version History

    Version Date Content

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/lang/Library. html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/lang/Library.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/lang/Library.html#http://books.zkoss.org/index.php?title=ZK_Client-side_Reference/Language_Definitionhttp://books.zkoss.org/index.php?title=ZK_Client-side_Reference/Language_Definition
  • 8/10/2019 ZK 5 Configuration Reference

    36/125

    The Library Properties 30

    The Library Properties

    Here is a list of supported library properties that ZK recognizes.

    To define a library property, you can configure it in WEB-INF/zk.xml[1]

    . For example,

    org.zkoss.zul.Button.mold

    trendy

    Alternatively, you can define it as a system property with the configuration file of your Web server, though the

    system property affects the whole system, not just one Web application.

    [1] For more information, please refer to the library-property element.

    class.moldProperty:

    class.mold

    Default: none

    [Since 5.0.0]

    It specified the default mold of the specified component. The property name is a concatenation of the class name of

    the component and mold. For example, the property for the button's default mold is called

    org.zkoss.zul.Button.mold .

    org.zkoss.zul.Button.mold

    trendy

    http://books.zkoss.org/index.php?title=ZK_Configuration_Reference/zk.xml/The_library-property_Element
  • 8/10/2019 ZK 5 Configuration Reference

    37/125

    org.zkoss.util.label.classpath.charset 31

    org.zkoss.util.label.classpath.charset

    Property:

    org.zkoss.util.label.classpath.charset

    Default: UTF-8

    [since 3.6.0]

    It defines the charset used to encode i3-label.properties if the file is located in classpath.

    To define the charset for i3-label.properties located in Web's resource, please refer to the

    org.zkoss.util.label.web.charset property.

    Please refer to ZK Developer's Reference: Internationalization for more information about i3-label.properties.

    org.zkoss.util.label.web.charset

    Property:

    org.zkoss.util.label.web.charset

    Default: UTF-8

    [since 3.6.2]

    It defines the charset used to encode i3-label.properties if the file is located in a Web application (i.e.,

    WEB-INF/i3-label*.properties ). Notice that all properties specified in the label-location element must be

    encoded in the same encoding as specified here.

    To define the charset for i3-label.properties located in classpath (i.e., part of a JAR file), please refer to the

    org.zkoss.util.label.classpath.charset property.

    Please refer to ZK Developer's Reference: Internationalization for more information about i3-label.properties.

    http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Internationalization/Labelshttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Internationalization/Labels
  • 8/10/2019 ZK 5 Configuration Reference

    38/125

    org.zkoss.util.label.web.location 32

    org.zkoss.util.label.web.location

    Property:

    org.zkoss.util.label.web.location

    Default: /WEB-INF/i3-label.properties

    [Since 3.6.2]

    It specifies which properties file for the internationalization labels are named and located.

    For 5.0.7 and later, it is suggested to use the label-location element instead, since it allows users to specify multiple

    properties files. In addition, the lable-location element has higher priority.

    org.zkoss.util.logging.config.file

    Property:

    org.zkoss.util.logging.config.file

    Default: none

    [Since 6.0.0]

    It specifies the logging configuration file which is used to configure the logging of ZK internal functions. You

    generally don't need it unless you'd like to know how ZK operates internally. For more information, please refer to

    ZK Developer's Reference: Logger.

    For example,

    org.zkoss.util.logging.config.file

    conf/zk-log.properties

    If a relative path is specified, it will look for the class path first. If not found, it will assume it is related to the current

    directory, i.e., the directory specified in the system property called user.dir.

    You could specify an absolute path, such as /usr/jetty/conf/zk-log.properties, if you are not sure what the current

    directory is.

    http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Supporting_Utilities/Loggerhttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Internationalization/Labels
  • 8/10/2019 ZK 5 Configuration Reference

    39/125

    org.zkoss.util.logging.hierarchy.disabled 33

    org.zkoss.util.logging.hierarchy.disabled

    Property:

    org.zkoss.util.logging.hierarchy.disabled

    Default: false

    [Since 5.0.9]

    It disables the use of the hierarchy hierarchical .

    Notice that this setting was introduced, because Googal App Engine doesn't allow

    java.util.logging.LogManager , which is required if the hierarchical logging is used. For more

    information, please refer to ZK Installation Guide: Google App Engine.

    org.zkoss.util.logging.realCauseBriefly

    Property:

    org.zkoss.util.logging.realCauseBriefly

    Default: 6

    [Since 3.6.1]

    It defines the number of lines to log an error message.

    If nonpositive is specified, the full stack traces are logged. Notice that # of lines don't include packages starting with

    java, javax, sun, or bsh.

    http://books.zkoss.org/index.php?title=ZK_Installation_Guide/Setting_up_Servers/Google_App_Engine
  • 8/10/2019 ZK 5 Configuration Reference

    40/125

    org.zkoss.web.classWebResource.cache 34

    org.zkoss.web.classWebResource.cache

    Property:

    org.zkoss.web.classWebResource.cache

    Default: true

    [Since 3.6.3]

    It specifies whether to allow the browsers to cache so-called class Web resources[1]

    .

    By default, it is true. It means the static class Web resources are cached in browsers if possible, unless you upgrade

    ZK to a different version.

    Notice the you can control the immutable period of the CSS files of class Web resources with

    another property called org.zkoss.web.classWebResource.cache.CSS.hours.

    If you are developing a component, it is better to turn it off (so you can force browser to load modified CSS and JS

    files by pressing F5).

    org.zkoss.web.classWebResource.cache

    false

    [1] Class Web resources are resources that can be loaded by use of "~./*".

    org.zkoss.web.classWebResource.cache.CSS.hours

    Property:

    org.zkoss.web.classWebResource.cache.CSS.hours

    Default: 8760

    [Since 3.6.3]

    It specifies the number of hours in that period the CSS files of class Web resources won't be changed.

    By default, it is 8760 (the same as other class Web resources). Notice that the resource is reloaded. If you want toturn off the cache of the CSS files of class Web resources, you can specify a non-positive value.

    org.zkoss.web.classWebResource.cache.CSS.hours

    8760

  • 8/10/2019 ZK 5 Configuration Reference

    41/125

    org.zkoss.web.classWebResource.cache.etag 35

    org.zkoss.web.classWebResource.cache.etag

    Property:

    org.zkoss.web.classWebResource.cache.etag

    Default: false

    [Since 5.0.1]

    It specifies whether to use ETag to detect and return 304 for matched resource.

    If turned on, the cached resource won't be reloaded if the user presses F5 to reload.

    org.zkoss.web.util.resource.dir

    Property:

    org.zkoss.web.util.resource.dir

    Default: none

    [Since 5.0.0]

    It specifies a directory, where ZK will load the so-called Class-Web Resources (CWR), in addition to the class path.

    CWR includes JavaScript files, CSS files, and other resources that are specified in the form of ~./xxx.

    By default, ZK only searches the class path for the required CWR. By specifying a directory here, ZK will search the

    directory first and then the class path. This implies that a developer can override the default behavior by providing a

    file with the same name.

    Notice: never put security sensitive files in the directory specified here, since they can be accessed externally.

    For example, assuming that we have a JavaScript package called foo.great and we want to put it to

    WEB-INF/cwr, we have to specify the following in WEB-INF/zk.xml:

    org.zkoss.web.util.resource.dir

    /WEB-INF/cwr

    You can place zk.wpd and the required JavaScript files under the WEB-INF/cwr/js/foo/great directory.

    Overriding JAR's JavaScript Files

    Though rarely needed, you could still override a JavaScript file of a JAR file with this option. One example is that

    you don't have to re-package zul.jar when replacing zul/inp/Textbox.js that is part of zul.jar.

    Rather, you could specify this library property as described above, and place the modified version of Textbox.js

    under the /WEB-INF/cwr/js/zul/inp directory. Then, ZK will load /WEB-INF/cwr/js/zul/inp/Textbox.js you placed

    rather than the default one in zul.jar.

    Notice that if debug-js is turned on, ZK will actually look for Textbox.src.js rather than Textbox.js in the above

    example. Thus, it is suggested to put both Textbox.src.js and Textbox.js the /WEB-INF/cwr/js/zul/inp directories. In

    addition, Textbox.src.js is suggested to be the readable one (for debugging purpose), while Textbox.js is the

  • 8/10/2019 ZK 5 Configuration Reference

    42/125

    org.zkoss.web.util.resource.dir 36

    compressed one (for production purpose).

    org.zkoss.web.servlet.http.URLEncoder

    Property:

    org.zkoss.web.servlet.http.URLEncoder

    Default: javax.servlet.http.HttpServletResponse.encodeURL

    [Since 5.0.0]

    It specifies the class used to encode URL by including the session ID and Servlet's context path, if necessary. The

    specified class must implement the URLEncoder[1]

    interface.

    If the clients are far away from the server, you might override this class by encoding the URL of JavaScript and CSS

    files with a server nearby. Thus, it could shorten the time to load a page. For more information, please refer to

    Performance Tips.

    In a sophisticated environment, e.g., Reverse Proxy[2]

    , the encoded URL might have to be prefixed with some

    special prefix. To do that, you can implement the URLEncoder[1]

    interface, and then specify the class with this

    library property.

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/web/servlet/http/Encodes/URLEncoder. html#

    [2] http:/ /en. wikipedia. org/wiki/Reverse_proxy

    org.zkoss.zk.config.pathProperty:

    org.zkoss.zk.config.path

    Default: none

    [since 5.0.7]

    It specifies the second configuration file in addition to WEB-INF/zk.xml. This is useful if you have two or more

    environments, such as testing and production. Then, you could put the different configuration into separated files and

    load the required files based on the requirement.

    The value could be one of the following:

    A servlet path, such as /WEB-INF/config/zk-extra.xml

    A file path, such as file:///home/http/zk.xml and file:///C:/test/zk.xml, if you use Windows. Notice it must start

    with file://[1]

    .

    A URL, such as http://foo.com/config/zk.xml. Notice it must starts with http://, https://, and ftp://.

    Notice that WEB-INF/zk.xml is always loaded, and it is loaded before the configuration file specified in this

    system property. Thus, you could put the configurations common to each environment in WEB-INF/zk.xml, and

    put the difference to the extra configuration file.

    For example, assume you put the configuration in a file called /configs/zk-production.xml , then you

    could specify -Dorg.zkoss.zk.config.path=file:/configs/zk-production.xml as one of the

    arguments when starting the Web server.

    http://en.wikipedia.org/wiki/Reverse_proxyhttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/web/servlet/http/Encodes/URLEncoder.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/web/servlet/http/Encodes/URLEncoder.html#http://en.wikipedia.org/wiki/Reverse_proxyhttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Performance_Tips/Load_JavaScript_and_CSS_from_Server_Nearbyhttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/web/servlet/http/Encodes/URLEncoder.html#
  • 8/10/2019 ZK 5 Configuration Reference

    43/125

    org.zkoss.zk.config.path 37

    Another example is to provide an ID generator for the testing purpose. For more information, please refer to ZK

    Developer's Reference: Testing Tips.

    [1] For more information about the URI of a file, please refer to File URI scheme (http://en. wikipedia.org/wiki/File_URI_scheme).

    Version HistoryVersion Date Content

    5.0.7 April, 2011 Introduced

    org.zkoss.zk.scripting.bsh.method.serializable

    Property:

    org.zkoss.zk.scripting.bsh.method.serializable

    Default: true

    [since 5.0.0]

    To disable the serialization of BeanShell method(s).

    org.zkoss.zk.scripting.bsh.method.serializable

    false

    Version History

    Version Date Content

    http://en.wikipedia.org/wiki/File_URI_schemehttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Testing/Testing_Tips%23Different_Configuration_for_Different_Environmenthttp://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Testing/Testing_Tips%23Different_Configuration_for_Different_Environment
  • 8/10/2019 ZK 5 Configuration Reference

    44/125

    org.zkoss.zk.ui.composer.autowire.zscript 38

    org.zkoss.zk.ui.composer.autowire.zscript

    Property:

    org.zkoss.zk.ui.composer.autowire.zscript

    Default: true (it is default to false in 6.0)

    [since 5.0.6]

    It specifies whether GenericAutowireComposer[1]

    (and GenericForwardComposer[2]

    ) should wire the variables

    defined in zscript.

    Some people reported that the wiring of zscript variables might cause some performance degrade if there are a lot of

    zscript code used in a page. You could specify this library variable as the follows to turn it off.

    org.zkoss.zk.ui.composer.autowire.zscript

    false

    Notice that, to have the best performance, it is recommended not to use zscript at all. For more more details, please

    refer to ZK Developer's Reference: Performance Tips.

    If you don't use any zscript, this option does not matter since ZK is smart enough to skip the wiring of zscript

    variables automatically.

    Version History

    Version Date Content

    5.0.6 Feburary, 2011 Introduced

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericAutowireComposer. html#

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericForwardComposer. html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericForwardComposer.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericAutowireComposer.html#http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/Performance_Tips/Use_Compiled_Java_Codeshttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericForwardComposer.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericAutowireComposer.html#
  • 8/10/2019 ZK 5 Configuration Reference

    45/125

    org.zkoss.zk.ui.composer.autowire.xel 39

    org.zkoss.zk.ui.composer.autowire.xel

    Property:

    org.zkoss.zk.ui.composer.autowire.xel

    Default: true (it is default to false in 6.0)

    [since 5.0.6]

    It specifies whether GenericAutowireComposer[1]

    (and GenericForwardComposer[2]

    ) should wire the variables

    defined in variable resolvers (XEL, see also the variable-resolver directive).

    For example, You could specify this library variable as follows to turn it off.

    org.zkoss.zk.ui.composer.autowire.xel

    false

    Version History

    Version Date Content

    5.0.6 Feburary, 2011 Introduced

    org.zkoss.zk.ui.EmulateIE7Property:

    org.zkoss.zk.ui.EmulateIE7

    Default: false

    [since 5.0.2]

    It specifies if we can make Internet Explorer 8 running in IE7 compatible mode. This can be used if some of your

    JavaScript code doesn't work well in IE8.

    For more information, please refer to MSDN: Introducing IE=EmulateIE7

    [1]

    .

    References

    [1] http:/ /blogs. msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7. aspx

    http://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspxhttp://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspxhttp://books.zkoss.org/index.php?title=ZUML_Reference/ZUML/Processing_Instructions/variable-resolverhttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericForwardComposer.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/util/GenericAutowireComposer.html#
  • 8/10/2019 ZK 5 Configuration Reference

    46/125

    org.zkoss.zk.ui.event.EventQueueProvider.class 40

    org.zkoss.zk.ui.event.EventQueueProvider.class

    Property:

    org.zkoss.zk.ui.event.EventQueueProvider.class

    Default: none(it implies EventQueueProviderImpl [1])

    [since 5.0.0]

    It specifies the name of the class used to provide the event queue. The class must implement the

    EventQueueProvider[2]

    interface.

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/impl/EventQueueProviderImpl. html#

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/impl/EventQueueProvider. html#

    org.zkoss.zk.ui.input.grouping.allowed

    Property:

    org.zkoss.zk.ui.input.grouping.allowed

    Default: true

    [since 5.0.5]

    Turn on/off whether the user is allowed to key in the grouping character when entering a number. The grouping

    character depends on the Locale. For example, it is a comma in English, and a dot in Germany. By default, ZK will

    allow the user to key in the grouping characters and the grouping characters are simply ignored when the input is

    parsed to a number.

    Some people still get confused whether the application considers a comma as a decimal point or not, when he is new

    to the application. By disabling the entering of the grouping character will help in this case.

    org.zkoss.zk.ui.input.grouping.allowed

    false

    If you want to disable it only for a particular page, you could specify it in the page's attribute (note: the page must be

    the root page). For example,

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/impl/EventQueueProvider.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/impl/EventQueueProviderImpl.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/impl/EventQueueProvider.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/impl/EventQueueProviderImpl.html#
  • 8/10/2019 ZK 5 Configuration Reference

    47/125

    org.zkoss.zk.ui.macro.autoforward.disabled 41

    org.zkoss.zk.ui.macro.autoforward.disabled

    Property:

    org.zkoss.zk.ui.macro.autoforward.disabled

    Default: false

    [since 5.0.4]

    Turn on/off auto forward mechanism for macro component

    org.zkoss.zk.ui.macro.autoforward.disabled

    true

    Version History

    Version Date Content

    5.0.4 August 2010 org.zkoss.zk.ui.macro.autoforward.disabled Turn on/off auto forward mechanism for macro component

    org.zkoss.zk.ui.macro.autowire.disabled

    Property:

    org.zkoss.zk.ui.macro.autowire.disabled

    Default: false

    [since 5.0.4]

    Turn on/off auto wire mechanism for macro component

    org.zkoss.zk.ui.macro.autowire.disabled

    true

    Version History

    Version Date Content

    5.0.4 August 2010 org.zkoss.zk.ui.macro.autowire.disabled Turn on/off auto wire mechanism for macro component

  • 8/10/2019 ZK 5 Configuration Reference

    48/125

    org.zkoss.zk.ui.metainfo.page.Loader.class 42

    org.zkoss.zk.ui.metainfo.page.Loader.class

    Property:

    org.zkoss.zk.ui.metainfo.page.Loader.class

    Default: none

    [since 5.0.4]

    It specifies the name of the class used to load the page definitions. The class must implement the Loader[1]

    interface

    and it must have a constructor as follows.

    publicFooLoader(org.zkoss.zk.ui.WebAppwapp){//assume FooLoader is

    the implementation class

    ...

    The default iimplementation is straightforward:

    privatestaticclassMyLoaderextends

    org.zkoss.web.util.resource.ResourceLoader{

    privatefinalWebApp _wapp;

    privateMyLoader(WebApp wapp){

    _wapp =wapp;

    }

    //-- super --//

    protectedObject parse(String path,File file,Object extra)

    throwsException {

    finalLocator locator =

    extra !=null?(Locator)extra:getLocator(_wapp,

    path);

    returnnewParser(_wapp,locator).parse(file,path);

    }

    protectedObject parse(String path,URL url,Object extra)

    throwsException {

    finalLocator locator =

    extra !=null?(Locator)extra:getLocator(_wapp,

    path);

    returnnewParser(_wapp,locator).parse(url,path);

    }

    }

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/Loader.html#
  • 8/10/2019 ZK 5 Configuration Reference

    49/125

    org.zkoss.zk.ui.metainfo.page.Loader.class 43

    Version History

    Version Date Content

    5.0.4 August 2010 org.zkoss.zk.ui.metainfo.page.Loader.class It specifies the name of the class used to load the page definitions.

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/Loader. html#

    org.zkoss.zk.ui.uuidRecycle.disabled

    Property:

    org.zkoss.zk.ui.uuidRecycle.disabled

    Default: false(i.e., UUID recycle is enabled)

    [since 5.0.3]

    It specifies whether to disable the recycle of UUID. By recycling UUID it will reduce the memory use of the

    browser. It is enabled by default.

    org.zkoss.zk.ui.sys.XMLResourcesLocator.class

    Property:

    org.zkoss.zk.ui.sys.XMLResourcesLocator.class

    Default: none(it implies ClassLocator[1]

    )

    [since 6.6.0]

    It specifies the name of the class used to load metainfo/config.xml, metainfo/lang.xml and metainfo/lang-addon.xml.

    By default, they are loaded from the class path. If you prefer to load them from other locations, implement the

    XMLResourcesLocator[2]

    interface.

    Notice that you can specify the property in WEB-INF/zk.xml, since it is too late. Rather, you have to specify in

    the server's configuration (as a system property).

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/ClassLocator.html#

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/XMLResourcesLocator. html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/XMLResourcesLocator.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/ClassLocator.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/XMLResourcesLocator.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/ClassLocator.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/util/resource/Loader.html#
  • 8/10/2019 ZK 5 Configuration Reference

    50/125

  • 8/10/2019 ZK 5 Configuration Reference

    51/125

    org.zkoss.zul.borderlayout.animation.disabed 45

    org.zkoss.zul.borderlayout.animation.disabed

    Property:

    org.zkoss.zul.borderlayout.animation.disabed

    Default: false

    [Since 5.0.8]

    It specifies whether disable the animation of the borderlayout component.

    For more information, please refer to ZK Component Reference.

    org.zkoss.zul.client.rod

    Property:

    org.zkoss.zul.client.rod

    Default: true

    [Enterprise Edition]

    [since 5.0.0]

    It specifies whether to apply Client Render on Demand.

    Notice that you can enable or disable this feature a particular component and all its descendants by specifying a

    custom attribute called org.zkoss.zul.client.rod.

    http://books.zkoss.org/index.php?title=ZK_Developer%2527s_Reference/Performance_Tips/Client_Render_on_Demandhttp://books.zkoss.org/index.php?title=ZK_Component_Reference/Layouts/Borderlayout%23Configure_to_Disable_the_Animation_Effects_as_Default
  • 8/10/2019 ZK 5 Configuration Reference

    52/125

    org.zkoss.zul.include.mode 46

    org.zkoss.zul.include.mode

    Property:

    org.zkoss.zul.include.mode

    Default: auto (5.0)

    Default: defer (3.x)

    [Since 3.6.2]

    It specifies the default mode of the include component. In ZK 3 and prior, the default mode is defer, which is

    backward-compatible with the prior version. Since ZK 5, the default mode is auto for easier control.

    For more information, please refer to ZK Component Reference.

    org.zkoss.zul.grid.autoSortProperty:

    org.zkoss.zul.grid.autoSort

    Default: false

    [Since 5.0.7]

    Specifies whether to sort the model when the following cases:

    Grid.setModel(ListModel)[1]

    is called and Column.setSortDirection(String)[2]

    is set.

    Column.setSortDirection(String)[2]

    is called.

    Model receives ListDataEvent[3]

    and Column.setSortDirection(String)[2]

    is set.

    If you want to ignore sort when receiving ListDataEvent[3]

    , you can specify the value to be ignore.change.

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    Version History

    Version Date Content

    5.0.7 April 2011 Grid shall sort model based on current state.

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid. html#setModel(ListModel)

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Column. html#setSortDirection(String)

    [3] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/event/ListDataEvent.html#

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/event/ListDataEvent.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Column.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid.html#setModel(ListModel)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/event/ListDataEvent.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Column.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/event/ListDataEvent.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Column.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Column.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid.html#setModel(ListModel)http://books.zkoss.org/index.php?title=ZK_Component_Reference/Essential_Components/Include
  • 8/10/2019 ZK 5 Configuration Reference

    53/125

    org.zkoss.zul.grid.preloadSize 47

    org.zkoss.zul.grid.preloadSize

    Property:

    org.zkoss.zul.grid.preloadSize

    Default: 7

    [Since 5.0.8]

    Specifies the number of rows to preload when receiving the rendering request from the client. It is used only for live

    data (Grid.setModel(ListModel)[1]

    ) but not paging (Grid.getPagingChild()[1]

    ).

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    Version History

    Version Date Content

    5.0.8 June 2011 Deprecated setPreloadSize, instead with a custom attributes "org.zkoss.zul.grid.preloadSize".

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid. html#getPagingChild()

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid.html#getPagingChild()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid.html#getPagingChild()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid.html#setModel(ListModel)
  • 8/10/2019 ZK 5 Configuration Reference

    54/125

    org.zkoss.zul.grid.initRodSize 48

    org.zkoss.zul.grid.initRodSize

    Property:

    org.zkoss.zul.grid.initRodSize

    Default: 100

    [Since 5.0.8]

    Specifies the number of rows rendered when the Grid first render. It is used only for live data

    (Grid.setModel(ListModel)[1]

    ) but not paging (Grid.getPagingChild()[1]

    ).

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    Version History

    Version Date Content

    5.0.8 June 2011 Add a custom attributes "org.zkoss.zul.grid.initRodSize" for control ROD render size.

    org.zkoss.zul.listbox.checkmarkDeselectOthers

    Property:

    org.zkoss.zul.listbox.checkmarkDeselectOthers

    Default: false

    [Since 5.0.5]

    If a listbox's checkmark (Listbox.isCheckmark()[1]

    ) is enabled, the selection will be toggled when an user clicks an

    item. In other words, all other items will remain the same.

    If you prefer to deselect all other items and select the item being clicked (which the behavior of ZK 5.0.4 and

    earlier), you could specify true to this library property.

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#isCheckmark()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid.html#getPagingChild()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Grid.html#setModel(ListModel)
  • 8/10/2019 ZK 5 Configuration Reference

    55/125

    org.zkoss.zul.listbox.checkmarkDeselectOthers 49

    Version History

    Version Date Content

    5.0.5 September

    2010

    org.zkoss.zul.listbox.checkmarkDeselectOthers and org.zkoss.zul.tree.checkmarkDeselectOthers are introduced to control

    how to select items when an item is clicked on a tree or a listbox with checkmark.

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox. html#isCheckmark()

    org.zkoss.zul.listbox.rightSelect

    Property:

    org.zkoss.zul.listbox.rightSelect

    Default: true

    [Since 5.0.5]

    If a listbox's checkmark (Listbox.isCheckmark()[1]

    ) is enabled, the selection will be toggled when the user right

    clicks on an item.

    If you prefer not to select/deselect item with right click, you could specify false to this library property.

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    Version History

    Version Date Content

    5.0.5 October

    2010

    org.zkoss.zul.listbox.rightSelect and org.zkoss.zul.tree.rightSelect are introduced to control whether to toggle item selection

    or not when an item is right clicked on a tree or a listbox with checkmark.

    5.0.7 April 2011org.zkoss.zul.listbox.rightSelect and org.zkoss.zul.tree.rightSelect could be specified as component's attribute (boolean)

    Component.getAttribute(java.lang.String, boolean) [1]).

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Component. html#getAttribute(java. lang. String,

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Component.html#getAttribute(java.lang.String,http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Component.html#getAttribute(java.lang.String,http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#isCheckmark()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#isCheckmark()
  • 8/10/2019 ZK 5 Configuration Reference

    56/125

    org.zkoss.zul.listbox.groupSelect 50

    org.zkoss.zul.listbox.groupSelect

    Property:

    org.zkoss.zul.listbox.groupSelect

    Default: false

    [Since 5.0.7]

    Giving true on this property makes Listgroups selectable in Listbox.

    ...

    Version History

    Version Date Content

    org.zkoss.zul.listbox.autoSort

    Property:

    org.zkoss.zul.listbox.autoSort

    Default: false

    [Since 5.0.7]

    Specifies whether to sort the model when the following cases:

    Listbox.setModel(ListModel)[1]

    is called and Listheader.setSortDirection(String)[2]

    is set.

    Listheader.setSortDirection(String)[2]

    is called.

    Model receives ListDataEvent[3]

    and Listheader.setSortDirection(String)[2]

    is set.

    If you want to ignore sort when receiving ListDataEvent[3]

    , you can specify the value as ignore.change.

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/event/ListDataEvent.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listheader.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/event/ListDataEvent.html#http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listheader.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listheader.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#setModel(ListModel)
  • 8/10/2019 ZK 5 Configuration Reference

    57/125

    org.zkoss.zul.listbox.autoSort 51

    Version History

    Version Date Content 5.0.7 April 2011 Listbox shall sort model based on current state.

    References[1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox. html#setModel(ListModel)

    [2] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listheader.html#setSortDirection(String)

    org.zkoss.zul.listbox.preloadSize

    Property:

    org.zkoss.zul.listbox.preloadSize

    Default: 7

    [Since 5.0.8]

    Specifies the number of items to preload when receiving the rendering request from the client. It is used only if live

    data (Listbox.setModel(ListModel)[1]

    ) and not paging (Listbox.getPagingChild()[1]

    ).

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    Version History

    Version Date Content

    5.0.8 June 2011 Deprecated setPreloadSize, instead with a custom attributes "org.zkoss.zul.listbox.preloadSize".

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox. html#getPagingChild()

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#getPagingChild()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#getPagingChild()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#setModel(ListModel)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listheader.html#setSortDirection(String)http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#setModel(ListModel)
  • 8/10/2019 ZK 5 Configuration Reference

    58/125

    org.zkoss.zul.listbox.initRodSize 52

    org.zkoss.zul.listbox.initRodSize

    Property:

    org.zkoss.zul.listbox.initRodSize

    Default: 100

    [Since 5.0.8]

    Specifies the number of items rendered when the Listbox first render. It is used only if live data

    (Listbox.setModel(ListModel)[1]

    ) and not paging (Listbox.getPagingChild()[1]

    ).

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    Version History

    Version Date Content

    5.0.8 June 2011 Add a custom attributes "org.zkoss.zul.listbox.initRodSize" for control ROD render size.

    org.zkoss.zul.numberFormat

    Property:

    org.zkoss.zul.numberFormat

    Default: ##,##0.##

    [Since 5.0.9]

    It specifies the default format when the locale of the NumberInputElement is specified.

    Note: if the format is specified already, this setting won't take effect.

    http://books.zkoss.org/index.php?title=ZK_Component_Reference/Base_Components/NumberInputElement%23Per-component_Localehttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#getPagingChild()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Listbox.html#setModel(ListModel)
  • 8/10/2019 ZK 5 Configuration Reference

    59/125

  • 8/10/2019 ZK 5 Configuration Reference

    60/125

    org.zkoss.zul.theme.browserDefault 54

    org.zkoss.zul.theme.browserDefault

    Property:

    org.zkoss.zul.theme.browserDefault

    Default: false (override browser default with ours)

    [Since 3.6.0]

    It specifies whether or not to override the standard HTML tags, such as body's margin and padding.

    org.zkoss.zul.theme.fontFamilyC

    Property:

    org.zkoss.zul.theme.fontFamilyC

    Default: arial, sans-serif

    [Since 3.6.0]

    It specifies the font used for the content in the ZUL CSS file.

    org.zkoss.zul.theme.fontFamilytT

    Property:

    org.zkoss.zul.theme.fontFamilytT

    Default: arial, sans-serif

    [Since 3.6.0]

    It specifies the font used for the title in the ZUL CSS file.

  • 8/10/2019 ZK 5 Configuration Reference

    61/125

    org.zkoss.zul.theme.fontSizeM 55

    org.zkoss.zul.theme.fontSizeM

    Property:

    org.zkoss.zul.theme.fontSizeM

    Default: 12px

    [Since 3.6.0]

    It specifies the size of the middle font used in the ZUL CSS file.

    org.zkoss.zul.theme.fontSizeMS

    Property:

    org.zkoss.zul.theme.fontSizeMS

    Default: 11px

    [Since 3.6.0]

    It specifies the size of the middle-smaller font used in the ZUL CSS file.

    org.zkoss.zul.theme.fontSizeS

    Property:

    org.zkoss.zul.theme.fontSizeS

    Default: 11px

    [Since 3.6.0]

    It specifies the size of the smaller font used in the ZUL CSS file.

  • 8/10/2019 ZK 5 Configuration Reference

    62/125

    org.zkoss.zul.theme.fontSizeXS 56

    org.zkoss.zul.theme.fontSizeXS

    Property:

    org.zkoss.zul.theme.fontSizeXS

    Default: 10px

    [Since 3.6.0]

    It specifies the size of the extreme small font used in the ZUL CSS file.

    org.zkoss.zul.tree.checkmarkDeselectOthers

    Property:

    org.zkoss.zul.tree.checkmarkDeselectOthers

    Default: false

    [Since 5.0.5]

    If a tree's checkmark (Tree.isCheckmark()[1]

    ) is enabled, the selection will be toggled when a user clicks an item. In

    other words, all other items will remain the same.

    If you prefer to deselect all other items and select the item being clicked (which the behavior of ZK 5.0.4 and

    earlier), you could specify true to this library property.

    If you prefer to configure a particular component, you could specify it as the custom attribute of the component or

    any of its ancestor components.

    ...

    Version History

    Version Date Content

    5.0.5 October

    2010

    org.zkoss.zul.listbox.rightSelect and org.zkoss.zul.tree.rightSelect are introduced to control whether to toggle item selection

    or not when an item is right clicked on a tree or a listbox with checkmark.

    5.0.7 April 2011 org.zkoss.zul.listbox.rightSelect and org.zkoss.zul.tree.rightSelect could be specified as component's attribute (boolean)

    Component.getAttribute(java.lang.String, boolean)[1]

    ).

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Tree. html#isCheckmark()

    http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Tree.html#isCheckmark()http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Component.html#getAttribute(java.lang.String,http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/Tree.html#isCheckmark()
  • 8/10/2019 ZK 5 Configuration Reference

    63/125

  • 8/10/2019 ZK 5 Configuration Reference

    64/125

  • 8/10/2019 ZK 5 Configuration Reference

    65/125

    The org.zkoss.zk.ui.event.EventThreadInit Interface 59

    The org.zkoss.zk.ui.event.EventThreadInit

    Interface

    Listener:

    org.zkoss.zk.ui.event.EventThreadInit

    A listener could implement EventThreadInit[1]

    to initialize an event processing thread, before an event is dispatched

    to it for processing.

    Notice that it is useless unless the event processing threads are enabled (it is disabled by default).

    If a listener implements this interface, an instance is created, and then the prepare method is called in the main

    thread (aka., the servlet thread), before processing an event. Then, the init method is called in the event

    processing thread.

    If a developer wants to prevent an event from being processed, he can throw an exception in the prepare method

    or the init method.

    A typical use of this feature is to implement auto-authentication. For example, JBoss[2]

    required you to call

    SecurityAssociation.setPrincipal to grant permissions of a user to the event processing thread.

    Instantiation: An independent instance of the given class is instantiated each time before the method is invoked. It

    means it is thread safe, and all information stored in non-static members will be lost after called.

    References

    [1] http:/ /www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/EventThreadInit. html#

    [2] http:/ /www.jboss.org

    http://www.jboss.org/http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/EventThreadInit.html#http://www.jboss.org/http://books.zkoss.org/index.php?title=ZK_Developer%27s_Reference/UI_Patterns/Event_Threadshttp://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/event/EventThreadInit.html#
  • 8/10/2019 ZK 5 Configuration Reference

    66/125

    The org.zkoss.zk.ui.event.EventThreadResume interface 60

    The org.zkoss.zk.ui.event.EventThreadResume

    interface

    Listener:

    org.zkoss.zk.ui.event.EventThreadResume

    A listener could implement EventThreadResume[1]

    , such that it will be called after an event processing thread is

    resumed or aborted.

    Notice that it is useless unless the event processing threads are enabled (it is disabled by default).

    If a listener implements this interface, an instance is created, and then the beforeResume method is called in the

    main thread (aka., the servlet thread), when a suspended event thread is being resumed. Then, the afterResume

    method is called in the event processing thread after the thread is resumed successfully.

    If a developer wants to prevent an event from being resumed, he can throw an exception in the beforeResume

    method.

    Notice that beforeResume executes in the main thread, so it shares the same thread-local storage with the main

    thread. On the other hand, afterResume executes in the event processing thread, so it shares the same

    thread-local storage with the event thread (and application event listeners).

    In addition to resuming normally, a suspended event processing thread might be aborted abnormally. For example,

    when the desktop is destroyed, all the suspended event threads will be aborted. When the suspended event processing

    thread is aborted, an instance is created, and the abortResume method is called in the main thread.

    Note: If a suspended event thread is aborted, none of the beforeResume and afterResume is called.

    Moreover, the cleanup and complete methods of EventThreadCleanup won't be called, either. Thus,

    you have to handle all necessary cleanups in abortResume.

    Inst