IDEMPIERE-6311 Parent context missing when zoom to detail tab above level 1 (#2554)

This commit is contained in:
hengsin 2024-11-24 21:45:34 +08:00 committed by Carlos Ruiz
parent 9bb107864f
commit f4fb07b66f
1 changed files with 16 additions and 2 deletions

View File

@ -587,21 +587,29 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
}
//execute query for each parent tab
GridTab pTab = null;
for (Map.Entry<Integer, MQuery> entry : queryMap.entrySet())
{
GridTab pTab = gridWindow.getTab(entry.getKey());
pTab = gridWindow.getTab(entry.getKey());
IADTabpanel tp = adTabbox.findADTabpanel(pTab);
tp.createUI();
if (tp.getTabLevel() == 0)
{
pTab.setQuery(entry.getValue());
tp.query();
//update context
if (pTab.getRowCount() > 0)
pTab.setCurrentRow(0, false);
}
else
{
{
tp.query();
pTab.setQuery(entry.getValue());
tp.query();
//update context
if (pTab.getRowCount() > 0) {
pTab.setCurrentRow(0, false);
}
}
}
@ -652,7 +660,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
}
if (id != null && id.equals(query.getZoomValue()))
{
//make sure last parent tab will update window context
boolean pTabUpdateWindowContext = pTab != null ? pTab.isUpdateWindowContext(): false ;
if (pTab != null && !pTabUpdateWindowContext)
pTab.setUpdateWindowContext(true);
setActiveTab(gridWindow.getTabIndex(gTab), null);
if (pTab != null && !pTabUpdateWindowContext)
pTab.setUpdateWindowContext(false);
gTab.navigate(i);
return true;
}