diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js b/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js index d51562a4e1..d8e9346bf3 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js +++ b/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js @@ -96,7 +96,8 @@ zkforge.KeyListener = zk.$extends(zul.Widget, { } evt.preventDefault(); - + // _autoBlur = true will let current focus control blur but this event is sent after key event, so haven't valuable + id.zk.Extend.fakeOnchange (zk.currentFocus); zAu.send(new zk.Event(zk.Widget.$(this), 'onCtrlKey', {keyCode: keycode, ctrlKey: evt.ctrlKey, shiftKey: evt.shiftKey, altKey: evt.altKey}, {toServer: true})); return false; diff --git a/org.adempiere.ui.zk/index.zul b/org.adempiere.ui.zk/index.zul index 203bb5918e..a3fd10f9d9 100644 --- a/org.adempiere.ui.zk/index.zul +++ b/org.adempiere.ui.zk/index.zul @@ -15,7 +15,17 @@ Copyright (C) 2007 Ashley G Ramdass. zk.afterLoad(function() { zk._Erbx.push = function(msg) { if (console) console.log(msg); - } + }; + + zk.$package('id.zk'); + + id.zk.Extend = zk.$extends(zk.Object, {}, { + fakeOnchange: function (wgt) { + // just sent fake event when control is textfield and value is not yet sync to server + if (wgt.$instanceof(zul.inp.Textbox) && wgt.$n().value != wgt.getText()) + zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value})); + } + }); }); zk.afterLoad(function() {