The library-property Element"

From Documentation
Line 5: Line 5:
 
     <name>any name</name>
 
     <name>any name</name>
 
     <value>any value</value>
 
     <value>any value</value>
 +
</library-property>
 +
 +
or
 +
 +
<library-property>
 +
    <name>any name</name>
 +
    <appendable>true</appendable>
 +
    <list>
 +
        <value>any value 1</value>
 +
        <value>any value 2</value>
 +
    </list>
 
  </library-property>
 
  </library-property>
  
Line 11: Line 22:
 
<source lang="java">
 
<source lang="java">
 
org.zkoss.lang.Library.setProperty("any name", "any value");
 
org.zkoss.lang.Library.setProperty("any name", "any value");
 +
</source>
 +
or
 +
<source lang="java">
 +
org.zkoss.lang.Library.addProperties("any name", List<String> values);
 
</source>
 
</source>
  

Revision as of 09:43, 23 May 2016


The library-property Element


Syntax:

<library-property>
    <name>any name</name>
    <value>any value</value>
</library-property>

or

<library-property>
    <name>any name</name>
    <appendable>true</appendable>
    <list>
        <value>any value 1</value>
        <value>any value 2</value>
    </list>
</library-property>

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");

or

org.zkoss.lang.Library.addProperties("any name", List<String> values);

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



Last Update : 2016/05/23

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