IDEMPIERE-4514 Grid View Layout Bug (#336)
Fix issue with first time switching of detail tab.
This commit is contained in:
parent
d2a2e3d19f
commit
904c8131be
|
@ -912,19 +912,19 @@ public class CompositeADTabbox extends AbstractADTabbox
|
||||||
if (!tabPanel.getGridTab().isSortTab()) {
|
if (!tabPanel.getGridTab().isSortTab()) {
|
||||||
currentRow = tabPanel.getGridTab().getCurrentRow();
|
currentRow = tabPanel.getGridTab().getCurrentRow();
|
||||||
}
|
}
|
||||||
tabPanel.query(false, 0, 0);
|
tabPanel.query(false, 0, 0);
|
||||||
if (currentRow >= 0 && currentRow != tabPanel.getGridTab().getCurrentRow()
|
if (currentRow >= 0 && currentRow != tabPanel.getGridTab().getCurrentRow()
|
||||||
&& 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()) {
|
||||||
|
@ -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
|
if (wasForm && tabPanel.getTabLevel() == 0 && headerTab.getTabLevel() != 0) // maintain form on header when zooming to a detail tab
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue