IDEMPIERE-4514 Grid View Layout Bug (#333)
This commit is contained in:
parent
e1cf1ada4d
commit
8a1301b1fc
|
@ -1721,7 +1721,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
||||||
if (listPanel.isVisible()) {
|
if (listPanel.isVisible()) {
|
||||||
listPanel.refresh(gridTab);
|
listPanel.refresh(gridTab);
|
||||||
listPanel.scrollToCurrentRow();
|
listPanel.scrollToCurrentRow();
|
||||||
listPanel.getListbox().invalidate();
|
listPanel.invalidate();
|
||||||
} else {
|
} else {
|
||||||
listPanel.deactivate();
|
listPanel.deactivate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ 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.zk.ui.util.Clients;
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
|
import org.zkoss.zul.Center;
|
||||||
import org.zkoss.zul.Menuitem;
|
import org.zkoss.zul.Menuitem;
|
||||||
import org.zkoss.zul.Row;
|
import org.zkoss.zul.Row;
|
||||||
import org.zkoss.zul.RowRenderer;
|
import org.zkoss.zul.RowRenderer;
|
||||||
|
@ -916,6 +917,11 @@ public class CompositeADTabbox extends AbstractADTabbox
|
||||||
&& currentRow < tabPanel.getGridTab().getRowCount()) {
|
&& currentRow < tabPanel.getGridTab().getRowCount()) {
|
||||||
tabPanel.getGridTab().setCurrentRow(currentRow, false);
|
tabPanel.getGridTab().setCurrentRow(currentRow, false);
|
||||||
}
|
}
|
||||||
|
Center center = findCenter(tabPanel.getGridView());
|
||||||
|
if (center != null)
|
||||||
|
center.invalidate();
|
||||||
|
else
|
||||||
|
tabPanel.invalidate();
|
||||||
}
|
}
|
||||||
if (!tabPanel.isVisible()) {
|
if (!tabPanel.isVisible()) {
|
||||||
tabPanel.setVisible(true);
|
tabPanel.setVisible(true);
|
||||||
|
@ -941,6 +947,18 @@ public class CompositeADTabbox extends AbstractADTabbox
|
||||||
tabPanel.switchRowPresentation();
|
tabPanel.switchRowPresentation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Center findCenter(GridView gridView) {
|
||||||
|
if (gridView == null)
|
||||||
|
return null;
|
||||||
|
Component p = gridView.getParent();
|
||||||
|
while (p != null) {
|
||||||
|
if (p instanceof Center)
|
||||||
|
return (Center)p;
|
||||||
|
p = p.getParent();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private void showLastError() {
|
private void showLastError() {
|
||||||
String msg = CLogger.retrieveErrorString(null);
|
String msg = CLogger.retrieveErrorString(null);
|
||||||
if (msg != null)
|
if (msg != null)
|
||||||
|
|
|
@ -58,6 +58,7 @@ import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
import org.zkoss.zk.ui.util.Clients;
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Cell;
|
import org.zkoss.zul.Cell;
|
||||||
|
import org.zkoss.zul.Center;
|
||||||
import org.zkoss.zul.Column;
|
import org.zkoss.zul.Column;
|
||||||
import org.zkoss.zul.Div;
|
import org.zkoss.zul.Div;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
|
@ -798,7 +799,11 @@ public class GridView extends Vlayout implements EventListener<Event>, IdSpace,
|
||||||
listModel.setPage(pgNo);
|
listModel.setPage(pgNo);
|
||||||
onSelectedRowChange(0);
|
onSelectedRowChange(0);
|
||||||
gridTab.clearSelection();
|
gridTab.clearSelection();
|
||||||
listbox.invalidate();
|
Center center = findCenter(this);
|
||||||
|
if (center != null)
|
||||||
|
center.invalidate();
|
||||||
|
else
|
||||||
|
this.invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event.getTarget() == selectAll)
|
else if (event.getTarget() == selectAll)
|
||||||
|
@ -830,6 +835,18 @@ public class GridView extends Vlayout implements EventListener<Event>, IdSpace,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Center findCenter(GridView gridView) {
|
||||||
|
if (gridView == null)
|
||||||
|
return null;
|
||||||
|
Component p = gridView.getParent();
|
||||||
|
while (p != null) {
|
||||||
|
if (p instanceof Center)
|
||||||
|
return (Center)p;
|
||||||
|
p = p.getParent();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isAllSelected() {
|
private boolean isAllSelected() {
|
||||||
org.zkoss.zul.Rows rows = listbox.getRows();
|
org.zkoss.zul.Rows rows = listbox.getRows();
|
||||||
List<Component> childs = rows.getChildren();
|
List<Component> childs = rows.getChildren();
|
||||||
|
@ -1203,7 +1220,11 @@ public class GridView extends Vlayout implements EventListener<Event>, IdSpace,
|
||||||
|
|
||||||
refresh(gridTab);
|
refresh(gridTab);
|
||||||
scrollToCurrentRow();
|
scrollToCurrentRow();
|
||||||
listbox.invalidate();
|
Center center = findCenter(this);
|
||||||
|
if (center != null)
|
||||||
|
center.invalidate();
|
||||||
|
else
|
||||||
|
this.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -139,6 +139,8 @@
|
||||||
|
|
||||||
.adwindow-detailpane-toolbar {
|
.adwindow-detailpane-toolbar {
|
||||||
border: none;
|
border: none;
|
||||||
|
height: 2em;
|
||||||
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adwindow-detailpane-toolbar .z-toolbar-body {
|
.adwindow-detailpane-toolbar .z-toolbar-body {
|
||||||
|
@ -189,6 +191,8 @@
|
||||||
|
|
||||||
.adwindow-detailpane-adtab-grid-south .z-paging {
|
.adwindow-detailpane-adtab-grid-south .z-paging {
|
||||||
padding: 0px !important;
|
padding: 0px !important;
|
||||||
|
height: 2em;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adwindow-detailpane-adtab-grid-south .z-paging .z-paging-inp {
|
.adwindow-detailpane-adtab-grid-south .z-paging .z-paging-inp {
|
||||||
|
|
Loading…
Reference in New Issue