Configuration

From Documentation
Revision as of 03:59, 18 March 2013 by Hawk (talk | contribs) (Created page with " {{UnderConstruction}} = Register Application Level Converters = {{ZK EE}} Since 6.0.1 You can register application level converters<ref>Application level converter only h...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WarningTriangle-32x32.png This page is under construction, so we cannot guarantee the accuracy of the content!


Register Application Level Converters

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


You can register application level converters[1] by setting library-property(org.zkoss.bind.appConverters) in zk.xml.

<library-property>
    <name>org.zkoss.bind.appConverters</name>
    <value>foo=my.FooConverter,bar=my.BarConverter</value>
</library-property>

Then use them by converter name.

<label value="@load(vm.message) @converter('foo')"/>
<label value="@load(vm.message) @converter('bar')"/>

  1. Application level converter only has one instance and is shared between all binders.


Register Application Level Validators

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

You can register application level validators[1] by setting library-property(org.zkoss.bind.appValidators) in zk.xml.

<library-property>
    <name>org.zkoss.bind.appValidators</name>
    <value>foo=my.FooValidator,bar=my.BarValidator</value>
</library-property>

Then use them by validator name.

<textbox value="@bind(vm.name) @validator('foo')"/>
<textbox value="@bind(vm.value) @validator('bar')"/>

  1. Application level validator only has one instance and is shared between all binders.