Configuration
From Documentation
Register Application Level Converters
- Available for ZK:
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')"/>
- ↑ Application level converter only has one instance and is shared between all binders.
Register Application Level Validators
- Available for ZK:
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')"/>
- ↑ Application level validator only has one instance and is shared between all binders.