-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi zk users; I have written a main template that includes header,left,center and footer templates.header,left and footer templates are same every page.But center template can be changeable every page.Now I have include template zul file above;
<zk>
<include src="/templates/mainTemplate.zul">
</include>
</zk>
So how to mange center template zul file (putting components for using) ? (Note : centerTemplate.zul file is empty.I fill this page on every page different.)
There are several ways to do that. It's not clear what you want.
(1) you can wrap all your stuff, header, footer and content in a dependent page. So all times all is new rendered.
wrap_content1.zul
<zk>
<include src="/templates/header.zul"/>
<include src="/templates/content1.zul"/>
<include src="/templates/footer.zul"/>
</zk>
wrap_content2.zul
<zk>
<include src="/templates/header.zul"/>
<include src="/templates/content2.zul"/>
<include src="/templates/footer.zul"/>
</zk>
(2) you can change only the content by appending your dependent zul page in the div.
main.zul
<zk>
<include src="/templates/header.zul"/>
<div id="mainContentDiv" />
<include src="/templates/footer.zul"/>
</zk>
onClickMenuItem:
mainContentDiv.getChildren().clear();
Executions.createComponents("/templates/myContent1.zul", mainContentDiv ,null);
hope this helps
best Stephan
Asked: 2015-02-04 08:55:57 +0800
Seen: 13 times
Last updated: Feb 04 '15