The library-property Element"

From Documentation
m
m (correct highlight (via JWB))
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{ZKConfigurationReferencePageHeader}}
 
{{ZKConfigurationReferencePageHeader}}
  
<source lang="xml" >
+
'''Syntax:'''
 +
<source lang='xml'>
 
  <library-property>
 
  <library-property>
 
     <name>any name</name>
 
     <name>any name</name>
 
     <value>any value</value>
 
     <value>any value</value>
 
  </library-property>
 
  </library-property>
  </source>
+
</source>
 +
or
 +
<source lang='xml'>
 +
<library-property>
 +
    <name>any name</name>
 +
    <appendable>true</appendable>
 +
    <list>
 +
        <value>any value 1</value>
 +
        <value>any value 2</value>
 +
    </list>
 +
</library-property>
 +
</source>
 +
 
 +
Species a library-level property with the <code>library-property</code> element. The above example is equivalent to
 +
 
 +
<source lang="java">
 +
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>
  
Species a library-level property with the <tt>library-property</tt> element. The above example is equivalent to
+
When "appendable" equals "true", it would add to the library properties of specific name rather then replace all of them. And "appendable" is "false" by default, .
  
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 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 are shared only within the application.
+
The library properties are easier to access than preferences since they are static members (of <javadoc>org.zkoss.lang.Library</javadoc>). 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.
  
The library properties are easier to access than the preferences since they are static members (of <javadoc>org.zkoss.lang.Library</javadoc>). However, their scope depends on the installation.
+
For a list of supported library properties, please take a look at [[ZK Configuration Reference/zk.xml/The Library Properties | Library Properties]].
  
 
==Version History==
 
==Version History==
 +
 +
{| border='1px' | width="100%"
 +
! Version !! Date !! Content
 +
|-
 +
| 8.0.2
 +
| May 24, 2016
 +
| Support "name" - "list" and "appendable"
 +
|}
  
 
{{ZKConfigurationReferencePageFooter}}
 
{{ZKConfigurationReferencePageFooter}}

Latest revision as of 10:21, 19 January 2022


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

When "appendable" equals "true", it would add to the library properties of specific name rather then replace all of them. And "appendable" is "false" by default, .

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
8.0.2 May 24, 2016 Support "name" - "list" and "appendable"



Last Update : 2022/01/19

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