-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I try to add a "template" as a component in lang-addon.xml
I do so by using the following syntax:
<language-addon>
<addon-name>simplelabel</addon-name>
<language-name>xul/html</language-name>
<!-- statusbox -->
<component>
<component-name>statusBox</component-name>
<template-uri>~./template/statusbox.zul</template-uri>
</component>
</language-addon>
Unfortunately, when "using" this component
<zk>
<window>
<statusBox />
</window>
</zk>
I get an exception:
There was an unexpected error (type=Internal Server Error, status=500).
file:/A:/git/C.../classes/web/dashboard.zul:13:84: Component definition not found: statusBox in [LanguageDefinition: xul/html]
org.zkoss.zk.ui.metainfo.DefinitionNotFoundException: file:/A:/git/C.../classes/web/dashboard.zul:13:84: Component definition not found: statusBox in [LanguageDefinition: xul/html]
at org.zkoss.zk.ui.metainfo.Parser.parseItem(Parser.java:920)
at org.zkoss.zk.ui.metainfo.Parser.parseItems(Parser.java:679)
at org.zkoss.zk.ui.metainfo.Parser.parseItem(Parser.java:1091)
at org.zkoss.zk.ui.metainfo.Parser.parseItems(Parser.java:679)
at org.zkoss.zk.ui.metainfo.Parser.parseItem(Parser.java:1091)
at org.zkoss.zk.ui.metainfo.Parser.parseItems(Parser.java:679)
...
Interestingly, if I add the "component" manually to the zul file, it works:
<?component name="statusBox" templateURI="~./template/statusbox.zul"?>
<zk>
<window>
<statusBox />
</window>
</zk>
Please advise.
using <template-uri>
requires zuti
module, please see https://www.zkoss.org/wiki/ZKClient-sideReference/LanguageDefinition/component#Requiredzuti
another example: https://github.com/zkoss-demo/admin-template/blob/master/src/main/resources/metainfo/zk/lang-addon.xml
Asked: 2023-03-16 01:29:31 +0800
Seen: 5 times
Last updated: Mar 20
composite component help [closed]
EL in a forEach @command not working?
Different template for each grid row
Cardlayout animation is broken
Grid RowRender slow using 6.5.1 and sizable=true
setVisible(false), component will load or not
Decimalbox and doublebox value rounded on iPad
history management with page status