当我尝试下面的代码时(正如Ryan Wu在question所建议的那样):
<?page title="Auto Generated index.zul"?>
<window title="Hello World 2!!" border="none" width="600px">
<include id="inc" src="/zk/wind.zul" mode="instant" />
<button label="do it" onClick="inc$wind.doModal()" />
</window>
按下按钮后,我收到此错误:
inc$wind.doModal();'' : Attempt to resolve method: doModal() on undefined variable or class name
文件wind.zul看起来像
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="wind" title="new page title" border="normal" visible="false" width="300px">
New Content Here!
</window>
</zk>
有人能告诉我什么是错的吗?感谢...
答案 0 :(得分:0)
根据http://books.zkoss.org/wiki/ZK%20Developer%27s%20Reference/UI%20Composing/ID%20Space 我需要: 1.使用'路径' 2.为主窗口添加一些ID(f.i。 id = “w0”) 并写入 index.zul 类似的东西(文件 wind.zul 未更改)
<?page title="Auto Generated index.zul"?>
<window id="w0" title="Hello World 2!!" border="none" width="600px">
<include id="inc" src="/zk/wind.zul" mode="instant" />
<button label="do it" onClick='Path.getComponent("/w0/inc/wind").doModal()' />
</window>
感谢我拥有:))