IDEMPIERE-627 Zk: Field group label unnecessary wrap to 2 row.

This commit is contained in:
Heng Sin Low 2013-02-13 19:46:40 +08:00
parent 053f63f5f9
commit 394b719779
3 changed files with 17 additions and 10 deletions

View File

@ -454,10 +454,10 @@ DataStatusListener, IADTabpanel, IdSpace
else else
{ {
Group rowg = new Group(fieldGroup); Group rowg = new Group(fieldGroup);
Cell cell = new Cell(); Cell cell = (Cell) rowg.getFirstChild();
cell.setSclass("z-group-inner"); cell.setSclass("z-group-inner");
cell.setColspan(numCols); cell.setColspan(numCols+1);
rowg.appendChild(cell); // rowg.appendChild(cell);
allCollapsibleGroups.add(rowg); allCollapsibleGroups.add(rowg);
if (X_AD_FieldGroup.FIELDGROUPTYPE_Tab.equals(field.getFieldGroupType()) || field.getIsCollapsedByDefault()) if (X_AD_FieldGroup.FIELDGROUPTYPE_Tab.equals(field.getFieldGroupType()) || field.getIsCollapsedByDefault())

View File

@ -8,7 +8,7 @@ import org.zkoss.zk.ui.UiException;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; 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.Image;
import org.zkoss.zul.Label; import org.zkoss.zul.Label;
import org.zkoss.zul.Row; 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; return cell != null && cell instanceof GroupHeader ? ((GroupHeader)cell).getTitle() : null;
} }
@Override
public void setLabel(String label) { public void setLabel(String label) {
autoFirstCell().setTitle(label); autoFirstCell().setTitle(label);
} }
@ -79,7 +80,7 @@ public class Group extends org.zkoss.zul.Group {
m_rows.add(row); m_rows.add(row);
} }
public static class GroupHeader extends Div implements EventListener<Event> public static class GroupHeader extends Cell implements EventListener<Event>
{ {
/** /**
* *
@ -101,7 +102,7 @@ public class Group extends org.zkoss.zul.Group {
private void init() private void init()
{ {
setZclass("z-group-cnt"); setZclass("z-group-header");
img = new Image(); img = new Image();
img.setZclass("z-group-img"); img.setZclass("z-group-img");
@ -109,6 +110,8 @@ public class Group extends org.zkoss.zul.Group {
img.addEventListener(Events.ON_CLICK, this); img.addEventListener(Events.ON_CLICK, this);
lbl = new Label(); lbl = new Label();
lbl.setStyle("cursor: pointer");
lbl.addEventListener(Events.ON_CLICK, this);
appendChild(lbl); appendChild(lbl);
} }
@ -135,10 +138,10 @@ public class Group extends org.zkoss.zul.Group {
{ {
if (e.getName().equals(Events.ON_CLICK)) if (e.getName().equals(Events.ON_CLICK))
{ {
if (e.getTarget() == img) // if (e.getTarget() == img)
{ // {
((Group) getParent()).setOpen(!isOpen()); ((Group) getParent()).setOpen(!isOpen());
} // }
} }
} }
} }

View File

@ -807,8 +807,12 @@ tr.z-group {
background-image: url(../images/group_bg.gif) !important; 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; font-family: Helvetica,Arial,sans-serif;
color: #333;
width: auto;
font-weight: bold;
font-size: 11px;
} }
.z-group td.z-group-inner { .z-group td.z-group-inner {