New Features of ZK 6.0.1

From Documentation
DocumentationSmall Talks2012MayNew Features of ZK 6.0.1
New Features of ZK 6.0.1

Author
Timothy Clare, Potix Corporation
Date
April 2, 2012
Version
ZK 6.0.1

Reference Binding

  • Available for ZK:
  • http://www.zkoss.org/product/zkhttp://www.zkoss.org/whyzk/zkeeVersion pe-ee.png

Reference binding allows us to reference an expression with a customized name. We can use this reference in another EL expression nested in the component that is binded to this reference.

A simple example is as follows:

<window apply="org.zkoss.bind.BindComposer" 
	viewModel="@id('vm') @init('foo.MyVM')">
	<vlayout p="@ref(vm.person)">
		<hlayout>
			First Name: <textbox value="@bind(p.firstName)" />
		</hlayout>
		<hlayout>
			Last Name: <textbox value="@bind(p.lastName)" />
		</hlayout>
	</vlayout>
</window>

Steps to use this feature:

  1. Bind a custom attribute on a component with @ref .
  2. Use the custom attribute in other EL expressions that are nested in children components

The above code shows these implemented steps, for more information and more uses please visit the ZK_Developer's_Reference/MVVM/Data_Binding/Reference_Binding developer's reference.

Download & other resources


Comments



Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.