diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java index bbfa070578..fc3befdbb9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java @@ -912,19 +912,19 @@ public class CompositeADTabbox extends AbstractADTabbox if (!tabPanel.getGridTab().isSortTab()) { currentRow = tabPanel.getGridTab().getCurrentRow(); } - tabPanel.query(false, 0, 0); + tabPanel.query(false, 0, 0); if (currentRow >= 0 && currentRow != tabPanel.getGridTab().getCurrentRow() && currentRow < tabPanel.getGridTab().getRowCount()) { tabPanel.getGridTab().setCurrentRow(currentRow, false); - } - Center center = findCenter(tabPanel.getGridView()); - if (center != null) - center.invalidate(); - else - tabPanel.invalidate(); + } } if (!tabPanel.isVisible()) { tabPanel.setVisible(true); + Executions.schedule(tabPanel.getDesktop(), e -> { + invalidateTabPanel(tabPanel); + }, new Event("onPostActivateDetail", tabPanel)); + } else { + invalidateTabPanel(tabPanel); } boolean wasForm = false; if (!tabPanel.isGridView()) { @@ -946,6 +946,14 @@ public class CompositeADTabbox extends AbstractADTabbox if (wasForm && tabPanel.getTabLevel() == 0 && headerTab.getTabLevel() != 0) // maintain form on header when zooming to a detail tab tabPanel.switchRowPresentation(); } + + private void invalidateTabPanel(IADTabpanel tabPanel) { + Center center = findCenter(tabPanel.getGridView()); + if (center != null) + center.invalidate(); + else + tabPanel.invalidate(); + } private Center findCenter(GridView gridView) { if (gridView == null)