-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to have a MVVM @template annotation that supports more than two outcomes?
The example shown below is taken from the ZK reference docs:
<combobox model="@bind(item.options ) @template(forEachStatus.index eq 0 or forEachStatus.index eq 2?'model1':'model2')">
... however, this only supports two outcomes: 'model1' and model2'. Can I have a situation where there are more than two template name outcomes? My specific situation will require around six different template names.
Alternatively can I drive @template from a bind bean property value?
Try using switch case:-
<zk switch="${each}">
<zk case="0">
<--your code-->
</zk>
<zk case="1">
<--your code -->
</zk>
<zk case="2">
<--your code -->
</zk>
<zk case="3">
<--your code -->
</zk>
</zk>
Hello davout,
this question I have already answered once for you.
Search for "How to define three or more models for use within a MVVM Tree?"
Kai
http://forum.zkoss.org/question/81118/how-to-define-three-or-more-models-for-use-within-a-mvvm-tree/ here is the link.
nsharma ( 2013-07-18 05:01:20 +0800 )editAsked: 2013-07-08 15:06:51 +0800
Seen: 19 times
Last updated: Jul 17 '13
Databinding and auto-complete on combobox
Composite component and bind in ZK 6
How to detach / reattach MVVM windows?
Is there a way to resolve view model properties as input to client side javascripts?
How can I synchronize data in a ListBox in MVVM ? [closed]
MVVM Validator: class not found ? [closed]
How to Call Child ViewModel Method from Parent Window? [closed]