From 394b719779c1af558d347d31d21350d4f1e2af61 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 13 Feb 2013 19:46:40 +0800 Subject: [PATCH] IDEMPIERE-627 Zk: Field group label unnecessary wrap to 2 row. --- .../org/adempiere/webui/adwindow/ADTabpanel.java | 6 +++--- .../src/org/adempiere/webui/component/Group.java | 15 +++++++++------ .../theme/default/css/theme.css.dsp | 6 +++++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 51f35f74a8..896cf3a4c8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -454,10 +454,10 @@ DataStatusListener, IADTabpanel, IdSpace else { Group rowg = new Group(fieldGroup); - Cell cell = new Cell(); + Cell cell = (Cell) rowg.getFirstChild(); cell.setSclass("z-group-inner"); - cell.setColspan(numCols); - rowg.appendChild(cell); + cell.setColspan(numCols+1); +// rowg.appendChild(cell); allCollapsibleGroups.add(rowg); if (X_AD_FieldGroup.FIELDGROUPTYPE_Tab.equals(field.getFieldGroupType()) || field.getIsCollapsedByDefault()) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Group.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Group.java index e4f8ec0241..c10087c9da 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Group.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Group.java @@ -8,7 +8,7 @@ import org.zkoss.zk.ui.UiException; 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.Div; +import org.zkoss.zul.Cell; import org.zkoss.zul.Image; import org.zkoss.zul.Label; import org.zkoss.zul.Row; @@ -43,6 +43,7 @@ public class Group extends org.zkoss.zul.Group { return cell != null && cell instanceof GroupHeader ? ((GroupHeader)cell).getTitle() : null; } + @Override public void setLabel(String label) { autoFirstCell().setTitle(label); } @@ -79,7 +80,7 @@ public class Group extends org.zkoss.zul.Group { m_rows.add(row); } - public static class GroupHeader extends Div implements EventListener + public static class GroupHeader extends Cell implements EventListener { /** * @@ -101,7 +102,7 @@ public class Group extends org.zkoss.zul.Group { private void init() { - setZclass("z-group-cnt"); + setZclass("z-group-header"); img = new Image(); img.setZclass("z-group-img"); @@ -109,6 +110,8 @@ public class Group extends org.zkoss.zul.Group { img.addEventListener(Events.ON_CLICK, this); lbl = new Label(); + lbl.setStyle("cursor: pointer"); + lbl.addEventListener(Events.ON_CLICK, this); appendChild(lbl); } @@ -135,10 +138,10 @@ public class Group extends org.zkoss.zul.Group { { if (e.getName().equals(Events.ON_CLICK)) { - if (e.getTarget() == img) - { +// if (e.getTarget() == img) +// { ((Group) getParent()).setOpen(!isOpen()); - } +// } } } } 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 472978de15..7a4abea084 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -807,8 +807,12 @@ tr.z-group { background-image: url(../images/group_bg.gif) !important; } -.z-group-inner .z-group-cnt .z-label, .z-group-inner .z-group-cnt { +.z-group-header .z-label { font-family: Helvetica,Arial,sans-serif; + color: #333; + width: auto; + font-weight: bold; + font-size: 11px; } .z-group td.z-group-inner {