BF [2910358] - Error in context when Key field is found in different tabs.

https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2910358&group_id=176962
This commit is contained in:
Carlos Ruiz 2009-12-10 23:33:18 +00:00
parent 18842d7ca0
commit 9f9e61da29
5 changed files with 20 additions and 15 deletions

View File

@ -102,7 +102,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
/**
*
*/
private static final long serialVersionUID = 7198494041906579986L;
private static final long serialVersionUID = -5882167959482156252L;
public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate";
@ -187,13 +187,15 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
private DataStatusEvent m_lastDataStatusEvent;
// Context property names:
public static final String CTX_KeyColumnName = "KeyColumnName";
public static final String CTX_LinkColumnName = "LinkColumnName";
public static final String CTX_TabLevel = "TabLevel";
public static final String CTX_AccessLevel = "AccessLevel";
public static final String CTX_AD_Tab_ID = "AD_Tab_ID";
public static final String CTX_Name = "Name";
public static final String CTX_AD_Table_ID = "AD_Table_ID";
public static final String CTX_KeyColumnName = "_TabInfo_KeyColumnName";
public static final String CTX_LinkColumnName = "_TabInfo_LinkColumnName";
public static final String CTX_TabLevel = "_TabInfo_TabLevel";
public static final String CTX_AccessLevel = "_TabInfo_AccessLevel";
public static final String CTX_AD_Tab_ID = "_TabInfo_AD_Tab_ID";
public static final String CTX_Name = "_TabInfo_Name";
public static final String CTX_AD_Table_ID = "_TabInfo_AD_Table_ID";
public static final String CTX_FindSQL = "_TabInfo_FindSQL";
public static final String CTX_SQL = "_TabInfo_SQL";

View File

@ -359,7 +359,7 @@ public class GridTable extends AbstractTableModel
m_SQL += " ORDER BY " + m_orderClause;
//
log.fine(m_SQL_Count);
Env.setContext(m_ctx, m_WindowNo, m_TabNo, "SQL", m_SQL);
Env.setContext(m_ctx, m_WindowNo, m_TabNo, GridTab.CTX_SQL, m_SQL);
return m_SQL;
} // createSelectSql

View File

@ -75,6 +75,7 @@ import org.compiere.model.DataStatusEvent;
import org.compiere.model.DataStatusListener;
import org.compiere.model.GridField;
import org.compiere.model.GridFieldVO;
import org.compiere.model.GridTab;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MProduct;
import org.compiere.model.MQuery;
@ -111,8 +112,10 @@ import org.compiere.util.ValueNamePair;
public final class Find extends CDialog
implements ActionListener, ChangeListener, DataStatusListener
{
/**
*
*/
private static final long serialVersionUID = 6414604433732835410L;
private int m_AD_Tab_ID;
/**
@ -1425,7 +1428,7 @@ public final class Find extends CDialog
String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(),
m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
finalSQL = Env.parseContext(Env.getCtx(), m_targetWindowNo, finalSQL, false);
Env.setContext(Env.getCtx(), m_targetWindowNo, TABNO, "FindSQL", finalSQL);
Env.setContext(Env.getCtx(), m_targetWindowNo, TABNO, GridTab.CTX_FindSQL, finalSQL);
// Execute Qusery
m_total = 999999;

View File

@ -427,8 +427,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
gridWindow.initTab(tabIndex);
GridTab gTab = gridWindow.getTab(tabIndex);
Env.setContext(ctx, curWindowNo, tabIndex, "TabLevel", Integer
.toString(gTab.getTabLevel()));
Env.setContext(ctx, curWindowNo, tabIndex, GridTab.CTX_TabLevel, Integer.toString(gTab.getTabLevel()));
// Query first tab
if (tabIndex == 0)

View File

@ -60,6 +60,7 @@ import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.part.MultiTabPart;
import org.compiere.model.GridField;
import org.compiere.model.GridFieldVO;
import org.compiere.model.GridTab;
import org.compiere.model.MLookupFactory;
import org.compiere.model.MProduct;
import org.compiere.model.MQuery;
@ -97,7 +98,7 @@ import org.zkoss.zul.Hbox;
public class FindWindow extends Window implements EventListener,ValueChangeListener
{
/**
*
*
*/
private static final long serialVersionUID = 4937678675702382252L;
/** Main Window for the Lookup Panel */
@ -1480,7 +1481,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe
String finalSQL = MRole.getDefault().addAccessSQL(sql.toString(),
m_tableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
finalSQL = Env.parseContext(Env.getCtx(), m_targetWindowNo, finalSQL, false);
Env.setContext(Env.getCtx(), m_targetWindowNo, TABNO, "FindSQL", finalSQL);
Env.setContext(Env.getCtx(), m_targetWindowNo, TABNO, GridTab.CTX_FindSQL, finalSQL);
// Execute Qusery
m_total = 999999;