GridWindowVO.AD_Table_ID is not initialized when window is loaded from cache
Description
Hi,
I'm migration a plugin from v11 to v12. It's a toolbar button which displays a popup, with items based on the BaseTable_ID of the window. Since the plugin is tested on v12, the popup opens only a single time. When user clicks on the button, we can show items. If he clicks later, nothing is shown ; he must open a new window.
Here's how I discover the BaseTable_ID : Env.getContextAsInt(Env.getCtx(), m_windowNo, "BaseTable_ID")
Some labels of the items are based on the tabs of the window. Here's how I search it :
Hi,
I'm migration a plugin from v11 to v12.
It's a toolbar button which displays a popup, with items based on the BaseTable_ID of the window.
Since the plugin is tested on v12, the popup opens only a single time.
When user clicks on the button, we can show items.
If he clicks later, nothing is shown ; he must open a new window.
Here's how I discover the BaseTable_ID :
Env.getContextAsInt(Env.getCtx(), m_windowNo, "BaseTable_ID")
Some labels of the items are based on the tabs of the window.
Here's how I search it :
private String getBtnLabel(String tableName, String adMsg) {
}
After some debug, I found that BaseTable_ID context variable is equals to 0.
In my plugin, GridWindow.get calls GridWindow.create and at the end it calls createTabs (vo); (line GridWindowVO line 235).
This method was revamped via https://idempiere.atlassian.net/browse/IDEMPIERE-6074
https://github.com/idempiere/idempiere/commit/d45c0ca55fc9de5ea1b75f5c15ac28b1e1bc6185#diff-e0f4b9e53ac15c7e687250050dd3443f84eb7b2c1d0fcd8df9c9710f29ee7f90
From what I see, if GridTabVOs are in cache, mWindowVO.AD_Table_ID is not initialized.