IDEMPIERE-2751:potential wrong status of info window

refactory, fix pass wrong parameter
This commit is contained in:
hieplq 2015-08-04 02:49:44 +08:00
parent bdbed7806e
commit 41efd70ce9
2 changed files with 8 additions and 12 deletions

View File

@ -469,10 +469,9 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
} }
@Override @Override
protected MInfoWindow loadInfoWindowData (int ADInfoWindowID){ protected void loadInfoWindowData (){
MInfoWindow infoWindow = null; if (m_infoWindowID > 0) {
if (AD_InfoWindow_ID > 0) { infoWindow = new MInfoWindow(Env.getCtx(), m_infoWindowID, null);
infoWindow = new MInfoWindow(Env.getCtx(), AD_InfoWindow_ID, null);
}else { }else {
infoWindow = MInfoWindow.get(p_tableName, (String)null); infoWindow = MInfoWindow.get(p_tableName, (String)null);
} }
@ -485,8 +484,6 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
throw new IllegalArgumentException("AD_InfoWindow.TableName <> TableName argument. ("+tableName + " <> " + p_tableName+")"); throw new IllegalArgumentException("AD_InfoWindow.TableName <> TableName argument. ("+tableName + " <> " + p_tableName+")");
} }
} }
return infoWindow;
} }
protected boolean loadInfoDefinition() { protected boolean loadInfoDefinition() {
@ -1868,7 +1865,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
*/ */
protected GridField getGridField(MInfoColumn infoColumn){ protected GridField getGridField(MInfoColumn infoColumn){
String columnName = infoColumn.getColumnName(); String columnName = infoColumn.getColumnName();
GridFieldVO vo = GridFieldVO.createParameter(infoContext, p_WindowNo, AEnv.getADWindowID(p_WindowNo), AD_InfoWindow_ID, 0, GridFieldVO vo = GridFieldVO.createParameter(infoContext, p_WindowNo, AEnv.getADWindowID(p_WindowNo), m_infoWindowID, 0,
columnName, infoColumn.get_Translation("Name"), infoColumn.getAD_Reference_ID(), columnName, infoColumn.get_Translation("Name"), infoColumn.getAD_Reference_ID(),
infoColumn.getAD_Reference_Value_ID(), false, false); infoColumn.getAD_Reference_Value_ID(), false, false);
if (infoColumn.getAD_Val_Rule_ID() > 0) { if (infoColumn.getAD_Val_Rule_ID() > 0) {

View File

@ -148,7 +148,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
/** Window Width */ /** Window Width */
static final int INFO_WIDTH = 800; static final int INFO_WIDTH = 800;
protected boolean m_lookup; protected boolean m_lookup;
protected int AD_InfoWindow_ID; protected int m_infoWindowID;
/************************************************** /**************************************************
* Detail Constructor * Detail Constructor
@ -190,12 +190,12 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
if (log.isLoggable(Level.INFO)) if (log.isLoggable(Level.INFO))
log.info("WinNo=" + WindowNo + " " + whereClause); log.info("WinNo=" + WindowNo + " " + whereClause);
p_tableName = tableName; p_tableName = tableName;
this.AD_InfoWindow_ID = ADInfoWindowID; this.m_infoWindowID = ADInfoWindowID;
p_keyColumn = keyColumn; p_keyColumn = keyColumn;
p_multipleSelection = multipleSelection; p_multipleSelection = multipleSelection;
m_lookup = lookup; m_lookup = lookup;
infoWindow = loadInfoWindowData(this.AD_InfoWindow_ID); loadInfoWindowData();
if (whereClause == null || whereClause.indexOf('@') == -1) if (whereClause == null || whereClause.indexOf('@') == -1)
p_whereClause = whereClause == null ? "" : whereClause; p_whereClause = whereClause == null ? "" : whereClause;
else else
@ -1136,9 +1136,8 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
/** /**
* query ADInfoWindow from ADInfoWindowID * query ADInfoWindow from ADInfoWindowID
* @param ADInfoWindowID
*/ */
protected MInfoWindow loadInfoWindowData (int ADInfoWindowID){return null;} protected void loadInfoWindowData (){}
/** /**
* Get Table name Synonym * Get Table name Synonym