IDEMPIERE-3179:record should move to editing mode when user is editing first field

just fire onChange for text conponent
This commit is contained in:
hieplq 2016-09-09 22:08:22 +07:00
parent 5adb11ed1c
commit ae3e003560
5 changed files with 15 additions and 1 deletions

View File

@ -180,6 +180,16 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
init();
}
/**
* Normal zk component just fire onChange event when user loss focus
* call this method with true value let component fire event when user type first character
* @param isChangeEventWhenEditing
*/
public void setChangeEventWhenEditing (boolean isChangeEventWhenEditing){
this.component.setWidgetOverride("isChangeEventWhenEditing", String.valueOf(isChangeEventWhenEditing));
}
/**
* Method is used to distinguish between 2 similar WSearchEditors
*

View File

@ -120,6 +120,7 @@ public class WNumberEditor extends WEditor implements ContextMenuListener
private void init()
{
setChangeEventWhenEditing (true);
if (gridField != null)
{
getComponent().setTooltiptext(gridField.getDescription());

View File

@ -32,11 +32,13 @@ public class WPasswordEditor extends WStringEditor
{
super(gridField);
super.setTypePassword(true);
setChangeEventWhenEditing (true);
}
public WPasswordEditor(GridField gridField, boolean tableEditor)
{
super(gridField, tableEditor);
super.setTypePassword(true);
setChangeEventWhenEditing (false);
}
}

View File

@ -117,6 +117,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener
private void init(String obscureType)
{
setChangeEventWhenEditing (true);
if (gridField != null)
{
getComponent().setMaxlength(gridField.getFieldLength());

View File

@ -57,7 +57,7 @@ Copyright (C) 2007 Ashley G Ramdass.
zk.override(zul.inp.InputWidget.prototype, "doInput_", function (evt) {
this.$doInput_(evt);
if (this.get ("isOnStardardWindow") == 'false'){
if (this.get ("isOnStardardWindow") == 'false' || this.get ("isChangeEventWhenEditing") != true){
return; // don't waste time to check component don't lay on standard window
}