-
Bug
-
Resolution: Fixed
-
Normal
-
8.5.1, 8.6.0.1
-
Security Level: Jimmy
-
ZK 8.6.1 S1
Steps to Reproduce
<zk> <zscript><![CDATA[ Constraint constraintByString = new SimpleConstraint("no empty"); Constraint constraintByFlag = new SimpleConstraint(SimpleConstraint.NO_EMPTY); ]]></zscript> working constraint <datebox constraint="${constraintByString}" /> <separator/> failing constraint <datebox constraint="${constraintByFlag}" /> (leaving empty produces JS error) </zk>
focus, then blur the dateboxes
Current Result
first datebox shows a wrong value message
second datebox causes a JS error
zul.inp.wpd:1464 Uncaught TypeError: Cannot read property 'length' of undefined at init._init (zul.inp.wpd:1464) at init.validate (zul.inp.wpd:1585) at init.validate_ (zul.inp.wpd:639) at init._validate (zul.inp.wpd:666) at init.updateChange_ (zul.inp.wpd:744) at init.$supers (zk.wpd:11786) at init.updateChange_ (zul.inp.wpd:2037) at init.$supers (zk.wpd:11786) at init.updateChange_ (zul.db.wpd:3374) at init.doBlur_ (zul.inp.wpd:479)
Expected Result
working constraint validation in both cases, no JS error
Debug Info
Root Cause
side effect of ZK-3527
Workaround
<script><![CDATA[ zk.afterLoad('zul.inp', function() { var xSimpleConstraint = {}; zk.override(zul.inp.SimpleConstraint.prototype, xSimpleConstraint, { reparseConstraint : function() { if(this._cst) { return xSimpleConstraint.reparseConstraint.apply(this, arguments); } } });//zk.override });//zk.afterLoad ]]></script>