-
FEATURED COMPONENTS
First time here? Check out the FAQ!
In my situation I have a list of objects in my first browser "page" and with a click on one row I get the details of one object.
I structured the detail 'page' in a 'main-zul' and several "sub-zul"s, which each contain one tab on this page. These sub-zuls are included by the zkoss-include-mechanism.
For structuring and reusing the zul-code this is a good mechanism, but I see several disadvantages:
I cannot pass parameters from the list-page to the sub-zuls. (I use Executions.createComponent() and the map is only transported to main-zul, because the include-Component is creating a new component with an own parameter-stack.)
The sub-zuls and the main-zul are not on the same zkoss-page, but on the same desktop. For eventing I see several advantages to use the page-level eventing. (No old listener to unsubscribe after a reload.)
Is there a possibilty to "include" zuls without having a new page, only to structure the zul-code?
Are there other mechanisms to structure zul-code?
Thanks
Christian
you can create your custom div
IncludeDiv extends Div implements AfterCompose
and than in this div inside the method
public void afterCompose()
you can use
Executions.createComponentsDirectly(contentString, "zul", this, args);
where args is the map of parameter you can pass to your div when you create it in your master zul where you use your include.
<includediv args="${arg}" componentName="file:metainfo/web/someTab.zul"/>
Asked: 2015-03-23 09:11:18 +0800
Seen: 20 times
Last updated: Mar 27 '15
Focus on the first input after closing modal window
MVVM : How can I add variable to applicationscope ?
Calling custom component constructor with params from zul
From a zul, how to access a component inside an include
ZK 7.0.3 doAfterCompose is not called for GenericForwardComposer