ZK How to set the date time format

To set the desired display format for a date in a ZK label, or in other controls, is it possible to use the @converter directive and set the built-in converter formateDate

Here an example:

	<label value="@load(vm.mydatevalue) @converter('formatedDate', format='dd-MMM-yyyy')" ></label>;

Tested with ZK version 6 and 7.

More information in the official documentation:
http://books.zkoss.org/zk-mvvm-book/8.0/data_binding/converter.html
See the paragraph “Use Built-in Converter”

Advertisements

ZK modify delay time for onChange instant event

For zk input widgets (like Textbox, Combobox, Datebox, ….) is possible to set the instant property to true in order to raise the onChange event without change the focus.
By default the onChange event is raised after 350 millisecond.
It’s possible modify the delay time by setting the value in your zul file.

Here an example how to do that:


<zk xmlns="http://www.zkoss.org/2005/zul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.zkoss.org/2005/zul  http://www.zkoss.org/2005/zul/zul.xsd "
	xmlns:n="native">

	<script type="text/javascript"><![CDATA[
		zk.afterLoad("zul.inp", function () {
				zul.inp.InputWidget.onChangingDelay=1000;
		});
	]]></script>	
		
....
</zk>