Use inplace edit mode for grid view.
This commit is contained in:
parent
37b24530e4
commit
6b4c3884ec
|
@ -20,10 +20,13 @@ package org.adempiere.webui.editor;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.adempiere.base.Service;
|
import org.adempiere.base.Service;
|
||||||
|
import org.adempiere.webui.component.EditorBox;
|
||||||
|
import org.adempiere.webui.component.NumberBox;
|
||||||
import org.adempiere.webui.factory.IEditorFactory;
|
import org.adempiere.webui.factory.IEditorFactory;
|
||||||
import org.compiere.model.GridField;
|
import org.compiere.model.GridField;
|
||||||
import org.compiere.model.GridTab;
|
import org.compiere.model.GridTab;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
|
import org.zkoss.zul.impl.InputElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -60,6 +63,23 @@ public class WebEditorFactory
|
||||||
if (editor != null)
|
if (editor != null)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (tableEditor)
|
||||||
|
{
|
||||||
|
if (editor.getComponent() instanceof InputElement)
|
||||||
|
{
|
||||||
|
((InputElement)editor.getComponent()).setInplace(true);
|
||||||
|
}
|
||||||
|
else if (editor.getComponent() instanceof EditorBox)
|
||||||
|
{
|
||||||
|
EditorBox box = (EditorBox) editor.getComponent();
|
||||||
|
box.getTextbox().setInplace(true);
|
||||||
|
}
|
||||||
|
else if (editor.getComponent() instanceof NumberBox)
|
||||||
|
{
|
||||||
|
NumberBox box = (NumberBox) editor.getComponent();
|
||||||
|
box.getDecimalbox().setInplace(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ import org.zkoss.zul.Separator;
|
||||||
import org.zkoss.zul.DefaultTreeNode;
|
import org.zkoss.zul.DefaultTreeNode;
|
||||||
import org.zkoss.zul.Space;
|
import org.zkoss.zul.Space;
|
||||||
import org.zkoss.zul.Treeitem;
|
import org.zkoss.zul.Treeitem;
|
||||||
|
import org.zkoss.zul.impl.InputElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -471,7 +472,11 @@ DataStatusListener, IADTabpanel, VetoableChangeListener
|
||||||
}
|
}
|
||||||
|
|
||||||
//streach component to fill grid cell
|
//streach component to fill grid cell
|
||||||
editor.fillHorizontal();
|
if (editor.getComponent() instanceof InputElement) {
|
||||||
|
((InputElement)editor.getComponent()).setHflex("1");
|
||||||
|
} else {
|
||||||
|
editor.fillHorizontal();
|
||||||
|
}
|
||||||
|
|
||||||
//setup editor context menu
|
//setup editor context menu
|
||||||
WEditorPopupMenu popupMenu = editor.getPopupMenu();
|
WEditorPopupMenu popupMenu = editor.getPopupMenu();
|
||||||
|
|
Loading…
Reference in New Issue