-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I recently started using ZK6 and I'm wondering is it possible to apply MVVM to custom composite components?
For example, I want to have composite component consisting of paging component + listbox component, which should implement custom logic for paging and sorting on the database.
Is it possible to do such a thing, from which component should I extend, how should I acquire and pass the annotated model like
model="@bind(vm.model) @template('template1')"
Hi,
Yes, it can. But currently there is still no complete document for this.
1. You should extend existing ZK class like HtmlMacroComponent.
2. declare a macro component
<?component name="editor3" macroURI="/bind/basic/composite3.zul" class="org.zkoss.zktest.bind.basic.MyComposite"?>
3. declare component definition annotation for binding
annotation syntax:
http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/annotation/ComponentAnnotation.html
see current component's definition in metainfo\zk\lang-addon.xml of zkbind.jar
Hope this will help.
Yes you can..See here i have a Macro Component for reordering..
Asked: 2012-09-06 12:15:35 +0800
Seen: 219 times
Last updated: Sep 19 '12