-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is there any way to override the default behavior to get/set properties.
Example:
<window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('zk.scala.test.ScalaTestVM')"> <grid model="@load(vm.users)"> <columns> <column label="Name"/> </columns> <template name="model" var="item"> <row> <label value="@load(item.name)"/> </row> </template> </grid> </window>
Instead of using the getUsers and getName, could I use other methods? like getProperty("name")
Also, is there any way to convert my custom collections to use in "grid model" and other components?
Hi shumy,
You can call the getProperty mathod with EL.
public String getProperty(String name) { return "text: "+name; }
<label value='@load(vm.getProperty("test"))'></label>
For more detail, you can refer to .http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/MVVM/Data_Binding/EL_Expression#Call_Methods
No, you need to use a convertor.
Asked: 2012-08-21 18:32:59 +0800
Seen: 140 times
Last updated: Oct 01 '12