-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I could not able to find a complete example using MVVM - Tree component.
Can you someone give me the link
I can't find too... :'(
But, maybe my personal experience can help you, if you can use Tree component in MVC.
Suppose "vm" is your ViewModel id in ZUL.
# add model attribute value:
<tree model="@load(vm.fooTreeModel)" >
# write <template> like this :
<template name="model" var="foo"> <treeitem> <treerow> <treecell label="@load(foo.data.fieldA)" /> <treecell label="@load(foo.data.fieldB)" /> </treerow> </treeitem> </template>
# The ViewModel class (is a POJO) need a method getFooTreeModel(), which return type is the same as the parameter type of foo.setModel in ComposerImplement.doAfterCompose() .
Hope these simple steps can help you to transform your MVC program to MVVM.
Regards,
Monty Pan
Hi,
have found a solution to the tree?
there is an example available?
thank you
Hi all,
Ok, here we are... \囧/
I write a simple but complete(maybe) example of Tree by ZK MVVM.
I put these code on github:
mvvmTree.zul
TreeVM.java
Product.java
Any feedback is welcome.
Regards,
Monty Pan
Asked: 2012-06-27 13:31:25 +0800
Seen: 354 times
Last updated: Aug 21 '12