Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.2
    • Fix Version/s: 8.6.3
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 8.6.3 S1

      Description

      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
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rudyhuang rudyhuang
                Reporter:
                cor3000 cor3000
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Time Spent - 2 hours Remaining Estimate - 2 hours
                  2h
                  Logged:
                  Time Spent - 2 hours Remaining Estimate - 2 hours
                  2h