0

Adding a template in lang-addon.xml fails

asked 2023-03-16 01:29:31 +0800

holos gravatar image holos
21 4

updated 2023-03-16 01:29:57 +0800

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.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0
link publish delete flag offensive edit

Comments

Thanks - yes, that did the trick :-)

holos ( 2023-03-20 22:12:13 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2023-03-16 01:29:31 +0800

Seen: 5 times

Last updated: Mar 20

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More