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
Latest changes broke windows where first tab has no parent key (like "Unposted Documents")
This commit is contained in:
Carlos Ruiz 2009-12-16 02:37:50 +00:00
parent 02fdcc78bd
commit 206dcfc075
1 changed files with 12 additions and 6 deletions

View File

@ -326,12 +326,18 @@ public class GridTable extends AbstractTableModel
//Restore the Original Value for Key Column Name based in Tab Context Value
int parentTabNo = getParentTabNo();
String parentKey = Env.getContext(m_ctx, m_WindowNo, parentTabNo, GridTab.CTX_KeyColumnName, true);
String valueKey = Env.getContext(m_ctx, m_WindowNo, parentTabNo, parentKey, true);
String currKey = Env.getContext(m_ctx, m_WindowNo, parentKey);
String valueKey = null;
String currKey = null;
if (parentKey != null && parentKey.length() > 0) {
valueKey = Env.getContext(m_ctx, m_WindowNo, parentTabNo, parentKey, true);
currKey = Env.getContext(m_ctx, m_WindowNo, parentKey);
if (currKey == null)
currKey = new String("");
if (valueKey != null && valueKey.length() > 0 && parentKey != null && parentKey.length() > 0 && ! currKey.equals(valueKey))
{
Env.setContext(m_ctx, m_WindowNo, parentKey, valueKey);
}
}
StringBuffer where = new StringBuffer("");
// WHERE