diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ListboxFactory.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ListboxFactory.java index 1331c21c3c..c4920d2699 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ListboxFactory.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ListboxFactory.java @@ -42,6 +42,13 @@ public class ListboxFactory { return dataTable; } + + public static WListbox newDataTableAutoSize() { + WListbox listBox = newDataTable(); + listBox.setSizedByContent(true); + listBox.setSpan(true); + return listBox; + } public static Listbox newDropdownListbox(String[] items) { Listbox listbox = newDropdownListbox(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListItemRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListItemRenderer.java index e8897b7b80..f4fb44ec7f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListItemRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/WListItemRenderer.java @@ -284,7 +284,7 @@ public class WListItemRenderer implements ListitemRenderer, EventListene else { listcell.setLabel(format.format(((Number)field).doubleValue())); - ZkCssHelper.appendStyle(listcell, "width: 96%; text-align: right"); + ZkCssHelper.appendStyle(listcell, "text-align: right"); } } } @@ -303,7 +303,7 @@ public class WListItemRenderer implements ListitemRenderer, EventListene else { listcell.setLabel(dateFormat.format((Timestamp)field)); - ZkCssHelper.appendStyle(listcell, "width: 96%; margin: auto"); + ZkCssHelper.appendStyle(listcell, "margin: auto"); } } else if (field instanceof String) @@ -340,7 +340,6 @@ public class WListItemRenderer implements ListitemRenderer, EventListene else { listcell.setLabel(field.toString()); - ZkCssHelper.appendStyle(listcell, "width: 96%;"); } } } @@ -358,7 +357,6 @@ public class WListItemRenderer implements ListitemRenderer, EventListene { listcell.setLabel(field.toString()); listcell.setValue(field.toString()); - ZkCssHelper.appendStyle(listcell, "width: 96%;"); } } else diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java index cf04b3a4e3..8e378d5e94 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java @@ -163,7 +163,7 @@ public class InfoProductWindow extends InfoWindow { String s_sqlFrom = " M_PRODUCT_STOCK_V "; /** Where Clause */ String s_sqlWhere = "M_Product_ID = ?"; - warehouseTbl = ListboxFactory.newDataTable(); + warehouseTbl = ListboxFactory.newDataTableAutoSize(); m_sqlWarehouse = warehouseTbl.prepareTable(s_layoutWarehouse, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_STOCK_V"); m_sqlWarehouse += " GROUP BY Warehouse"; warehouseTbl.setMultiSelection(false); @@ -184,7 +184,7 @@ public class InfoProductWindow extends InfoWindow { new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class)}; s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V"; s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'S'"; - substituteTbl = ListboxFactory.newDataTable(); + substituteTbl = ListboxFactory.newDataTableAutoSize(); m_sqlSubstitute = substituteTbl.prepareTable(s_layoutSubstitute, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V"); substituteTbl.setMultiSelection(false); substituteTbl.autoSize(); @@ -203,14 +203,14 @@ public class InfoProductWindow extends InfoWindow { new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class)}; s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V"; s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'R'"; - relatedTbl = ListboxFactory.newDataTable(); + relatedTbl = ListboxFactory.newDataTableAutoSize(); m_sqlRelated = relatedTbl.prepareTable(s_layoutRelated, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V"); relatedTbl.setMultiSelection(false); relatedTbl.autoSize(); // relatedTbl.getModel().addTableModelListener(this); //Available to Promise Tab - m_tableAtp = ListboxFactory.newDataTable(); + m_tableAtp = ListboxFactory.newDataTableAutoSize(); m_tableAtp.setMultiSelection(false); //IDEMPIERE-337 @@ -229,7 +229,7 @@ public class InfoProductWindow extends InfoWindow { list.toArray(s_layoutProductPrice); s_sqlFrom = "M_ProductPrice pp INNER JOIN M_PriceList_Version plv ON (pp.M_PriceList_Version_ID = plv.M_PriceList_Version_ID)"; s_sqlWhere = "pp.M_Product_ID = ? AND plv.IsActive = 'Y' AND pp.IsActive = 'Y'"; - productpriceTbl = ListboxFactory.newDataTable(); + productpriceTbl = ListboxFactory.newDataTableAutoSize(); m_sqlProductprice = productpriceTbl.prepareTable(s_layoutProductPrice, s_sqlFrom, s_sqlWhere, false, "pp") + " ORDER BY plv.ValidFrom DESC"; productpriceTbl.setMultiSelection(false); productpriceTbl.autoSize(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index 34b97e2dda..7291ac8dcd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -1035,6 +1035,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL contentPanel.setStyle("width: 99%; margin: 0px auto;"); contentPanel.setVflex(true); contentPanel.setSizedByContent(true); + contentPanel.setSpan(true); North north = new North(); layout.appendChild(north);