From fa77d740aee571c3a89c642bb5b61f01a107e8f2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 4 May 2011 22:43:28 -0500 Subject: [PATCH] Implement #8 Allow number boxes wider http://hg.idempiere.com/idempiere/issue/8 --- .../src/org/adempiere/webui/editor/WNumberEditor.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java index 195971d503..99c0e552ce 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java @@ -49,7 +49,8 @@ public class WNumberEditor extends WEditor implements ContextMenuListener { public static final String[] LISTENER_EVENTS = {Events.ON_CHANGE, Events.ON_OK}; - public static final int MAX_DISPLAY_LENGTH = 20; + public static final int MAX_DISPLAY_LENGTH = 35; + public static final int MIN_DISPLAY_LENGTH = 11; private Object oldValue; @@ -109,6 +110,12 @@ public class WNumberEditor extends WEditor implements ContextMenuListener if (gridField != null) { getComponent().setTooltiptext(gridField.getDescription()); + int displayLength = gridField.getDisplayLength(); + if (displayLength > MAX_DISPLAY_LENGTH) + displayLength = MAX_DISPLAY_LENGTH; + else if (displayLength <= 0 || displayLength < MIN_DISPLAY_LENGTH) + displayLength = MIN_DISPLAY_LENGTH; + getComponent().getDecimalbox().setCols(displayLength); } if (!DisplayType.isNumeric(displayType))