diff --git a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java index 6c1f276a20..31b30f5d96 100644 --- a/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java +++ b/org.adempiere.ui.swing/src/org/adempiere/ui/swing/factory/DefaultInfoFactory.java @@ -120,10 +120,15 @@ public class DefaultInfoFactory implements IInfoFactory { else if (tableName.equals("S_ResourceAssigment")) info = new InfoAssignment (frame, modal, WindowNo, value, multiSelection, whereClause, lookup); - else + else { info = new InfoGeneral (frame, modal, WindowNo, value, - tableName, keyColumn, - multiSelection, whereClause, lookup); + tableName, keyColumn, + multiSelection, whereClause, lookup); + if (!info.loadedOK()) { + info.dispose(false); + info = null; + } + } // return info; } diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java index 3f0f7d8b41..45a5462226 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoGeneral.java @@ -100,6 +100,8 @@ public class InfoGeneral extends Info // statInit(); p_loadedOK = initInfo (); + if (!p_loadedOK) + return; // int no = p_table.getRowCount(); setStatusLine(Integer.toString(no) + " " @@ -233,14 +235,14 @@ public class InfoGeneral extends Info String sql = "SELECT c.ColumnName, t.AD_Table_ID, t.TableName, c.ColumnSql " + "FROM AD_Table t" + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)" - + "WHERE c.AD_Reference_ID=10" + + "WHERE c.AD_Reference_ID IN (10,14)" + " AND t.TableName=?" // #1 // Displayed in Window + " AND EXISTS (SELECT * FROM AD_Field f " + "WHERE f.AD_Column_ID=c.AD_Column_ID" + " AND f.IsDisplayed='Y' AND f.IsEncrypted='N' AND f.ObscureType IS NULL) " // - + "ORDER BY c.IsIdentifier DESC, c.SeqNo"; + + "ORDER BY c.IsIdentifier DESC, c.AD_Reference_ID, c.SeqNo"; int AD_Table_ID = 0; String tableName = null; PreparedStatement pstmt = null; @@ -278,6 +280,7 @@ public class InfoGeneral extends Info // Miminum check if (m_queryColumns.size() == 0) { + ADialog.error(p_WindowNo, this, "Error", "No query columns found"); log.log(Level.SEVERE, "No query columns found"); return false; } diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java index 66a9676ac0..74865147d4 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VCellRenderer.java @@ -21,6 +21,7 @@ import java.awt.Component; import java.awt.Insets; import java.text.DecimalFormat; import java.text.SimpleDateFormat; +import java.util.Date; import java.util.logging.Level; import javax.swing.JCheckBox; @@ -204,10 +205,16 @@ public final class VCellRenderer extends DefaultTableCellRenderer ; // Number else if (DisplayType.isNumeric(m_displayType)) - retValue = m_numberFormat.format(value); + if (value instanceof Number) + retValue = m_numberFormat.format(value); + else + retValue = value.toString(); // Date else if (DisplayType.isDate(m_displayType)) - retValue = m_dateFormat.format(value); + if (value instanceof Date) + retValue = m_dateFormat.format(value); + else + retValue = value.toString(); // Row ID else if (m_displayType == DisplayType.RowID) retValue = ""; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index 3b51b47991..f6c3736802 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -549,7 +549,8 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value getDirectAccessSQL("*"); final InfoPanel ip = InfoManager.create(lookup, gridField, m_tableName, m_keyColumnName, queryValue, false, whereClause); - showInfoPanel(ip); + if (ip != null) + showInfoPanel(ip); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java index 285dbbf556..f93a0cd528 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/factory/DefaultInfoFactory.java @@ -108,6 +108,10 @@ public class DefaultInfoFactory implements IInfoFactory { info = new InfoGeneralPanel (value, WindowNo, tableName, keyColumn, multiSelection, whereClause, lookup); + if (!info.loadedOK()) { + info.dispose(false); + info = null; + } } } // diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index fc2d42c04b..4b28577afd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -259,13 +259,13 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener String sql = "SELECT c.ColumnName, t.AD_Table_ID, t.TableName, c.ColumnSql " + "FROM AD_Table t" + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)" - + "WHERE c.AD_Reference_ID=10" + + "WHERE c.AD_Reference_ID IN (10,14)" + " AND t.TableName=?" // #1 // Displayed in Window + " AND EXISTS (SELECT * FROM AD_Field f " + "WHERE f.AD_Column_ID=c.AD_Column_ID" + " AND f.IsDisplayed='Y' AND f.IsEncrypted='N' AND f.ObscureType IS NULL) " - + "ORDER BY c.IsIdentifier DESC, c.SeqNo"; + + "ORDER BY c.IsIdentifier DESC, c.AD_Reference_ID, c.SeqNo"; int AD_Table_ID = 0; String tableName = null; @@ -310,6 +310,7 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener // Miminum check if (m_queryColumns.size() == 0) { + FDialog.error(p_WindowNo, this, "Error", "No query columns found"); log.log(Level.SEVERE, "No query columns found"); return false; }