IDEMPIERE-2751:potential wrong status of info window
This commit is contained in:
parent
8413fcb7ff
commit
bdbed7806e
|
@ -118,13 +118,11 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
|||
public static final int FIELDLENGTH = 20;
|
||||
|
||||
protected ColumnInfo[] columnInfos;
|
||||
protected MInfoWindow infoWindow;
|
||||
protected TableInfo[] tableInfos;
|
||||
protected MInfoColumn[] infoColumns;
|
||||
protected String queryValue;
|
||||
|
||||
private List<GridField> gridFields;
|
||||
private int AD_InfoWindow_ID;
|
||||
private Checkbox checkAND;
|
||||
/**
|
||||
* Menu contail process menu item
|
||||
|
@ -170,7 +168,6 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
|||
lookup);
|
||||
this.m_gridfield = field;
|
||||
this.queryValue = queryValue;
|
||||
this.AD_InfoWindow_ID = AD_InfoWindow_ID;
|
||||
|
||||
//Xolali IDEMPIERE-1045
|
||||
contentPanel.addActionListener(new EventListener<Event>() {
|
||||
|
@ -471,32 +468,38 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
|||
isQueryByUser = false;
|
||||
}
|
||||
|
||||
protected boolean loadInfoDefinition() {
|
||||
String tableName = null;
|
||||
@Override
|
||||
protected MInfoWindow loadInfoWindowData (int ADInfoWindowID){
|
||||
MInfoWindow infoWindow = null;
|
||||
if (AD_InfoWindow_ID > 0) {
|
||||
infoWindow = new MInfoWindow(Env.getCtx(), AD_InfoWindow_ID, null);
|
||||
if (!infoWindow.isValid()) {
|
||||
infoWindow = null;
|
||||
} else {
|
||||
tableName = MTable.getTableName(Env.getCtx(), infoWindow.getAD_Table_ID());
|
||||
if (!tableName.equalsIgnoreCase(p_tableName)) {
|
||||
throw new IllegalArgumentException("AD_InfoWindow.TableName <> TableName argument. ("+tableName + " <> " + p_tableName+")");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}else {
|
||||
infoWindow = MInfoWindow.get(p_tableName, (String)null);
|
||||
}
|
||||
|
||||
if (!infoWindow.isValid()) {
|
||||
infoWindow = null;
|
||||
} else {
|
||||
String tableName = MTable.getTableName(Env.getCtx(), infoWindow.getAD_Table_ID());
|
||||
if (!tableName.equalsIgnoreCase(p_tableName)) {
|
||||
throw new IllegalArgumentException("AD_InfoWindow.TableName <> TableName argument. ("+tableName + " <> " + p_tableName+")");
|
||||
}
|
||||
}
|
||||
|
||||
return infoWindow;
|
||||
}
|
||||
|
||||
protected boolean loadInfoDefinition() {
|
||||
if (infoWindow != null) {
|
||||
if (tableName == null)
|
||||
tableName = MTable.getTableName(Env.getCtx(), infoWindow.getAD_Table_ID());
|
||||
if (p_tableName == null)
|
||||
p_tableName = MTable.getTableName(Env.getCtx(), infoWindow.getAD_Table_ID());
|
||||
|
||||
AccessSqlParser sqlParser = new AccessSqlParser("SELECT * FROM " + infoWindow.getFromClause());
|
||||
tableInfos = sqlParser.getTableInfo(0);
|
||||
if (tableInfos[0].getSynonym() != null && tableInfos[0].getSynonym().trim().length() > 0) {
|
||||
p_tableName = tableInfos[0].getSynonym().trim();
|
||||
if (p_whereClause != null && p_whereClause.trim().length() > 0) {
|
||||
p_whereClause = p_whereClause.replace(tableName+".", p_tableName+".");
|
||||
p_whereClause = p_whereClause.replace(p_tableName+".", p_tableName+".");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,8 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
/** Window Width */
|
||||
static final int INFO_WIDTH = 800;
|
||||
protected boolean m_lookup;
|
||||
|
||||
protected int AD_InfoWindow_ID;
|
||||
|
||||
/**************************************************
|
||||
* Detail Constructor
|
||||
* @param WindowNo WindowNo
|
||||
|
@ -163,6 +164,13 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
this(WindowNo, tableName, keyColumn, multipleSelection, whereClause, true);
|
||||
}
|
||||
|
||||
protected InfoPanel (int WindowNo,
|
||||
String tableName, String keyColumn,boolean multipleSelection,
|
||||
String whereClause, boolean lookup){
|
||||
this(WindowNo, tableName, keyColumn, multipleSelection, whereClause,
|
||||
lookup, 0);
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* Detail Constructor
|
||||
* @param WindowNo WindowNo
|
||||
|
@ -172,7 +180,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
*/
|
||||
protected InfoPanel (int WindowNo,
|
||||
String tableName, String keyColumn,boolean multipleSelection,
|
||||
String whereClause, boolean lookup)
|
||||
String whereClause, boolean lookup, int ADInfoWindowID)
|
||||
{
|
||||
if (WindowNo <= 0) {
|
||||
p_WindowNo = SessionManager.getAppDesktop().registerWindow(this);
|
||||
|
@ -182,11 +190,12 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
if (log.isLoggable(Level.INFO))
|
||||
log.info("WinNo=" + WindowNo + " " + whereClause);
|
||||
p_tableName = tableName;
|
||||
this.AD_InfoWindow_ID = ADInfoWindowID;
|
||||
p_keyColumn = keyColumn;
|
||||
|
||||
p_multipleSelection = multipleSelection;
|
||||
m_lookup = lookup;
|
||||
|
||||
infoWindow = loadInfoWindowData(this.AD_InfoWindow_ID);
|
||||
if (whereClause == null || whereClause.indexOf('@') == -1)
|
||||
p_whereClause = whereClause == null ? "" : whereClause;
|
||||
else
|
||||
|
@ -208,7 +217,6 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
|
||||
setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "infopanel");
|
||||
|
||||
infoWindow = MInfoWindow.get(p_keyColumn.replace("_ID", ""), null);
|
||||
addEventListener(WindowContainer.ON_WINDOW_CONTAINER_SELECTION_CHANGED_EVENT, this);
|
||||
addEventListener(ON_RUN_PROCESS, this);
|
||||
addEventListener(Events.ON_CLOSE, this);
|
||||
|
@ -304,7 +312,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
/** PO Zoom Window */
|
||||
private int m_PO_Window_ID = -1;
|
||||
|
||||
private MInfoWindow infoWindow;
|
||||
protected MInfoWindow infoWindow;
|
||||
|
||||
/** Logger */
|
||||
protected CLogger log = CLogger.getCLogger(getClass());
|
||||
|
@ -1126,7 +1134,11 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
|
|||
return sb.toString();
|
||||
} // getSelectedSQL;
|
||||
|
||||
|
||||
/**
|
||||
* query ADInfoWindow from ADInfoWindowID
|
||||
* @param ADInfoWindowID
|
||||
*/
|
||||
protected MInfoWindow loadInfoWindowData (int ADInfoWindowID){return null;}
|
||||
|
||||
/**
|
||||
* Get Table name Synonym
|
||||
|
|
Loading…
Reference in New Issue