-
Bug
-
Resolution: Fixed
-
Normal
-
8.6.2
-
Security Level: Jimmy
-
ZK 8.6.3 S1
Steps to Reproduce
<timebox onChange="Clients.log(String.valueOf(event.getValue()) + self.value)"/>
update the value -> blur
clear the value -> blur
observe the event and component values logged
Current Result
clearing the time results in 12:00am instead of NULL
Expected Result
enable clearing the time value, to set a null value at server side
Debug Info
this worked in 8.6.1
Root Cause
Timebox.coerceFromString doesn't calculate the emptyCount, correctly missing to clear the value
https://github.com/zkoss/zk/blob/v8.6.2/zul/src/archive/web/js/zul/db/Timebox.js#L164-L184
possible side effect of ZK-4252 (8.6.2)
Workaround
by adding the following script an empty input can be detected -> returning an empty value
zk.afterLoad('zul.db', function() { var xTimebox = {}; zk.override(zul.db.Timebox.prototype, xTimebox, { coerceFromString_ : function(value) { if(/\d/.test(value)) { return xTimebox.coerceFromString_.apply(this, arguments); } this._changed = false; return; } });//zk.override });//zk.afterLoad
- relates to
-
ZK-4252 Paste still broken on a Timebox component after ZK-1749
- Closed