import"
m |
m |
||
Line 1: | Line 1: | ||
{{ZUMLReferencePageHeader}} | {{ZUMLReferencePageHeader}} | ||
− | + | '''Syntax:''' | |
<?import uri="..."?> | <?import uri="..."?> | ||
<?import uri="..." directives="..."?> | <?import uri="..." directives="..."?> | ||
− | |||
It imports the directives, such as component definitions (<tt><?component?></tt>) and initiators (<tt><?init?></tt>), defined in another ZUML page. | It imports the directives, such as component definitions (<tt><?component?></tt>) and initiators (<tt><?init?></tt>), defined in another ZUML page. | ||
Line 33: | Line 32: | ||
* Once the directives are imported, they won't be changed until the importing page is change, no matter the imported page is changed or not. | * Once the directives are imported, they won't be changed until the importing page is change, no matter the imported page is changed or not. | ||
− | + | = uri = | |
− | + | [Required] | |
− | |||
− | [Required] | ||
− | |||
The URI of a ZUML page which the component definitions will be imported from. | The URI of a ZUML page which the component definitions will be imported from. | ||
− | + | = directives = | |
− | + | [Optional] | |
− | |||
− | [Optional] | ||
− | |||
If the <tt>directives</tt> attribute is omitted, only the <tt>component</tt> and <tt>init</tt> directives are imported. If you want to import particular directives, you can specify a list of the names of the directives separated by comma. For example, | If the <tt>directives</tt> attribute is omitted, only the <tt>component</tt> and <tt>init</tt> directives are imported. If you want to import particular directives, you can specify a list of the names of the directives separated by comma. For example, | ||
Line 55: | Line 48: | ||
The directives that can be imported include <tt>component</tt>, <tt>init</tt>, <tt>meta</tt>, <tt>taglib</tt>, <tt>variable-resolver</tt>, and <tt>xel-method</tt>. If you want to import them all, specify * to the <tt>directives</tt> attribute. Notice that <tt>meta</tt> implies both the <tt>meta</tt>, <tt>link</tt> and <tt>script</tt> directives. | The directives that can be imported include <tt>component</tt>, <tt>init</tt>, <tt>meta</tt>, <tt>taglib</tt>, <tt>variable-resolver</tt>, and <tt>xel-method</tt>. If you want to import them all, specify * to the <tt>directives</tt> attribute. Notice that <tt>meta</tt> implies both the <tt>meta</tt>, <tt>link</tt> and <tt>script</tt> directives. | ||
− | + | =Version History= | |
{| border='1px' | width="100%" | {| border='1px' | width="100%" |
Revision as of 11:03, 18 November 2010
Syntax:
<?import uri="..."?> <?import uri="..." directives="..."?>
It imports the directives, such as component definitions (<?component?>) and initiators (<?init?>), defined in another ZUML page.
A typical use is that you put a set of component definitions in one ZUML page, and then import it in other ZUML pages, such that they share the same set of component definitions, additional to the system default.
<!-- special.zul: Common Definitions -->
<?init zscript="/WEB-INF/macros/special.zs"?>
<?component name="special" macroURI="/WEB-INF/macros/special.zuml" class="Special"?>
<?component name="another" macroURI="/WEB-INF/macros/another.zuml"?>
where the Special class is assumed to be defined in /WEB-INF/macros/special.zs.
Then, other ZUML pages can share the same set of component definitions as follows.
<?import uri="special.zul"?>
...
<special/><!-- you can use the component defined in special.zul -->
Notes
- Unlike other directives, the import directives must be at the topmost level, i.e., at the the same level as the root element.
- The imported directives in the imported page are also imported. For example, if A imports B and B imports C, then A imports both C and B component definitions. If there is a name conflict, A overrides B, while B overrides C.
- Once the directives are imported, they won't be changed until the importing page is change, no matter the imported page is changed or not.
uri
[Required]
The URI of a ZUML page which the component definitions will be imported from.
directives
[Optional]
If the directives attribute is omitted, only the component and init directives are imported. If you want to import particular directives, you can specify a list of the names of the directives separated by comma. For example,
<?import uri="/template/taglibs.zul" directives="taglib, xel-method"?>
The directives that can be imported include component, init, meta, taglib, variable-resolver, and xel-method. If you want to import them all, specify * to the directives attribute. Notice that meta implies both the meta, link and script directives.
Version History
Version | Date | Content |
---|---|---|