IDEMPIERE-4514 Grid View Layout Bug (#336)

Fix issue with first time switching of detail tab.
This commit is contained in:
hengsin 2020-10-31 22:24:44 +08:00 committed by GitHub
parent d2a2e3d19f
commit 904c8131be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 7 deletions

View File

@ -917,14 +917,14 @@ 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);
Executions.schedule(tabPanel.getDesktop(), e -> {
invalidateTabPanel(tabPanel);
}, new Event("onPostActivateDetail", tabPanel));
} else {
invalidateTabPanel(tabPanel);
} }
boolean wasForm = false; boolean wasForm = false;
if (!tabPanel.isGridView()) { if (!tabPanel.isGridView()) {
@ -947,6 +947,14 @@ public class CompositeADTabbox extends AbstractADTabbox
tabPanel.switchRowPresentation(); 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) { private Center findCenter(GridView gridView) {
if (gridView == null) if (gridView == null)
return null; return null;