diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java index 9127819944..c0ab816610 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java @@ -45,7 +45,6 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Cell; -import org.zkoss.zul.Div; import org.zkoss.zul.Grid; import org.zkoss.zul.Label; import org.zkoss.zul.Paging; @@ -252,11 +251,11 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt for (Entry entry : editors.entrySet()) { if (entry.getValue().getComponent().getParent() != null) { Component child = entry.getValue().getComponent(); - Div div = null; + Cell div = null; while (div == null && child != null) { Component parent = child.getParent(); - if (parent instanceof Div && parent.getParent() instanceof Row) - div = (Div)parent; + if (parent instanceof Cell && parent.getParent() instanceof Row) + div = (Cell)parent; else child = parent; } @@ -383,7 +382,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt } colIndex ++; - Div div = new Div(); + Cell div = new Cell(); String divStyle = CELL_DIV_STYLE; org.zkoss.zul.Column column = (org.zkoss.zul.Column) columns.getChildren().get(colIndex); if (column.isVisible()) { @@ -399,8 +398,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt } } div.setStyle(divStyle); - div.setWidth(column.getWidth()); - div.setHflex("1"); + div.setWidth("100%"); div.setAttribute("columnName", gridPanelFields[i].getColumnName()); div.addEventListener(Events.ON_CLICK, rowListener); div.addEventListener(Events.ON_DOUBLE_CLICK, rowListener); @@ -483,7 +481,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt org.zkoss.zul.Column column = (org.zkoss.zul.Column) columns.getChildren().get(colIndex); if (column.isVisible()) { - Div div = (Div) currentRow.getChildren().get(colIndex); + Cell div = (Cell) currentRow.getChildren().get(colIndex); div.getChildren().clear(); WEditor editor = getEditorCell(gridPanelFields[i]); div.appendChild(editor.getComponent()); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java index ef971e3e13..a72de2c419 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WEditor.java @@ -23,6 +23,7 @@ import java.beans.PropertyChangeListener; import java.util.ArrayList; import org.adempiere.webui.AdempiereWebUI; +import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.component.Bandbox; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Datebox; @@ -42,6 +43,7 @@ import org.zkoss.zk.ui.HtmlBasedComponent; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; +import org.zkoss.zul.Combobox; import org.zkoss.zul.Image; import org.zkoss.zul.Menuitem; import org.zkoss.zul.Textbox; @@ -489,7 +491,7 @@ public abstract class WEditor implements EventListener, PropertyChangeLis //can't stretch bandbox & datebox if (!(getComponent() instanceof Bandbox) && !(getComponent() instanceof Datebox)) { - String width = tableEditor ? "98%" : "100%"; + String width = tableEditor ? "96%" : "100%"; if (getComponent() instanceof Button) { if (!tableEditor) { Button btn = (Button) getComponent(); @@ -507,10 +509,19 @@ public abstract class WEditor implements EventListener, PropertyChangeLis image.setWidth("24px"); image.setHeight("24px"); } else { - if (getComponent() instanceof InputElement) { - ((InputElement)getComponent()).setHflex("1"); + if (!tableEditor) { + if (getComponent() instanceof InputElement) { + ((InputElement)getComponent()).setHflex("1"); + } else { + ((HtmlBasedComponent)getComponent()).setWidth(width); + } } else { - ((HtmlBasedComponent)getComponent()).setWidth(width); + if (getComponent() instanceof Combobox) { + LayoutUtils.addSclass("grid-combobox-editor", (HtmlBasedComponent)getComponent()); + } else { + ((HtmlBasedComponent)getComponent()).setWidth(width); + } + } if (getComponent() instanceof Textbox && tableEditor) { diff --git a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp index 0cea8785fb..be9e5182a3 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -997,4 +997,12 @@ tbody.z-grid-empty-body td { border-left: 5px dashed #696969; border-right: 5px dashed transparent; border-bottom: 5px solid transparent; +} + +.grid-combobox-editor { + width: 96% !important; +} + +.grid-combobox-editor input { + width: 85% !important; } \ No newline at end of file