0

Applying MVVM to composite components?

asked 2012-09-06 12:15:35 +0800

Lesstra gravatar image Lesstra
193 1

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')"

from the composite component declaration to the listbox within the component, and so on?
Thanks.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-09-19 09:38:48 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

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.

link publish delete flag offensive edit

answered 2012-09-19 12:11:49 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Yes you can..See here i have a Macro Component for reordering..

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-09-06 12:15:35 +0800

Seen: 219 times

Last updated: Sep 19 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More