ZK code that get's opened in modal dialog box:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" pageEncoding="UTF-8"
contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="zk" uri="http://www.zkoss.org/jsp/zul"%>
<zk:variable-resolver
use="org.zkoss.zkplus.spring.DelegatingVariableResolver" />
<zk:init use="org.zkoss.zkplus.databind.AnnotateDataBinderInit" />
<zk:page zscriptLanguage="java">
<zk:window>
<zk:tree id="tree" width="400px" rows="8">
<zk:treecols sizable="true">
<zk:treecol label="Name" />
<zk:treecol label="Description" />
</zk:treecols>
<zk:treechildren>
<zk:treeitem>
<zk:treerow>
<zk:treecell label="Item 1" />
<zk:treecell label="Item 1 description" />
</zk:treerow>
</zk:treeitem>
<zk:treeitem>
<zk:treerow>
<zk:treecell label="Item 2" />
<zk:treecell label="Item 2 description" />
</zk:treerow>
<zk:treechildren>
<zk:treeitem>
<zk:treerow>
<zk:treecell label="Item 2.1" />
</zk:treerow>
<zk:treechildren>
<zk:treeitem>
<zk:treerow>
<zk:treecell label="Item 2.1.1" />
</zk:treerow>
</zk:treeitem>
<zk:treeitem>
<zk:treerow>
<zk:treecell label="Item 2.1.2" />
</zk:treerow>
</zk:treeitem>
</zk:treechildren>
</zk:treeitem>
<zk:treeitem>
<zk:treerow>
<zk:treecell label="Item 2.2" />
</zk:treerow>
<zk:treechildren>
<zk:treeitem>
<zk:treerow>
<zk:treecell label="Item 2.2.1" />
</zk:treerow>
</zk:treeitem>
</zk:treechildren>
</zk:treeitem>
</zk:treechildren>
</zk:treeitem>
<zk:treeitem label="Item 3" />
</zk:treechildren>
</zk:tree>
</zk:window>
</zk:page>
Java code to open modal dialog box:
Include topicDetailInclude = new Include();
topicDetailInclude.setMode("auto");
String detailIncludeSrc = "/M/" + currentMId
+ "/C.edit";
topicDetailInclude.setSrc(detailIncludeSrc);
// create a new window and set some attributes
Window win = (Window) new Window();
win.setTitle("Add New Category");
win.setClosable(true);
win.setWidth("360px");
win.setHeight("320px");
win.appendChild(topicDetailInclude);
// attach to the main window
win.setParent(t);
win.doModal();