From 979c38bdfcc051df214f020b31799ac3e57c5bd4 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 13 Dec 2013 16:28:33 +0800 Subject: [PATCH 1/3] 1003572 Problem with Locator field on "Import Inventory" process. --- .../src/org/adempiere/webui/window/WLocatorDialog.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java index 569119a126..b7db1d0f50 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java @@ -43,6 +43,7 @@ import org.adempiere.webui.component.Window; import org.compiere.model.MLocator; import org.compiere.model.MLocatorLookup; import org.compiere.model.MRole; +import org.compiere.util.AdempiereUserError; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; @@ -303,6 +304,9 @@ public class WLocatorDialog extends Window implements EventListener if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString()); + if (m_mLocator.getSize()==0 || (m_mLocator.getSize()==1 && m_mLocator.get(m_mLocator.getElementAt(0))==null)) + throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false)); + for (int i = 0; i < m_mLocator.getSize(); i++) { Object obj = m_mLocator.getElementAt(i); @@ -552,7 +556,7 @@ public class WLocatorDialog extends Window implements EventListener if (m_change) { ListItem listitem = lstLocator.getSelectedItem(); - MLocator l = (MLocator)listitem.getValue(); + MLocator l = listitem != null ? (MLocator)listitem.getValue() : null; if (l != null) return l.getM_Locator_ID() == m_M_Locator_ID; From dc1ac231756722bc22767b0faaaccb46b1b65173 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 13 Dec 2013 17:11:33 +0800 Subject: [PATCH 2/3] 1003574 The "Print" button is mute and not working. Always show process info if there's error. --- .../org/adempiere/webui/adwindow/AbstractADWindowContent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index ee66df1cdc..e95ed650cb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -2900,7 +2900,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (Executions.getCurrent() != null) { - if (notPrint) // refresh if not print + if (notPrint || pi.isError()) // show process info if it is not print or have error { updateUI(pi); } @@ -2911,7 +2911,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements //acquire desktop, 2 second timeout Executions.activate(getComponent().getDesktop(), 2000); try { - if (notPrint) // refresh if not print + if (notPrint || pi.isError()) // show process info if it is not print or have error { updateUI(pi); } From ed0d30fd3150b2723f4ec907037ead65d5cb052e Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 13 Dec 2013 20:27:59 +0800 Subject: [PATCH 3/3] IDEMPIERE-1448 Import File Loader window is showing columnnames. Peer review and commit patch from Carlos Ruiz. --- .../src/org/compiere/impexp/ImpFormat.java | 4 +-- .../src/org/compiere/impexp/ImpFormatRow.java | 26 ++++++++++++++++++- .../org/compiere/apps/form/VFileImport.java | 2 +- .../webui/apps/form/WFileImport.java | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java index 7fe5ce75a6..68a22ab1f7 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java @@ -305,7 +305,7 @@ public final class ImpFormat private static void loadRows (ImpFormat format, int ID) { String sql = "SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength," // 1..6 - + "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout " // 7..11 + + "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout,f.Name " // 7..12 + "FROM AD_ImpFormat_Row f,AD_Column c " + "WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'" + "ORDER BY f.SeqNo"; @@ -319,7 +319,7 @@ public final class ImpFormat while (rs.next()) { ImpFormatRow row = new ImpFormatRow (rs.getInt(1), - rs.getString(2), rs.getInt(3), rs.getInt(4), rs.getString(5), rs.getInt(6)); + rs.getString(2), rs.getInt(3), rs.getInt(4), rs.getString(5), rs.getInt(6), rs.getString(12)); // row.setFormatInfo(rs.getString(7), rs.getString(8), rs.getString(9).equals("Y"), diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java index 262783244c..cb5bb447f6 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormatRow.java @@ -52,11 +52,13 @@ public final class ImpFormatRow * @param endNo and no * @param dataType data type - see constants DATATYPE_ * @param maxLength if String it is the maximum length (truncated) + * @param name column label */ - public ImpFormatRow(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength) + public ImpFormatRow(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength, String name) { m_seqNo = seqNo; setColumnName(columnName); + setName(name); m_startNo = startNo; m_endNo = endNo; setDataType (dataType); @@ -80,6 +82,7 @@ public final class ImpFormatRow private int m_seqNo; private String m_columnName; + private String m_name; private int m_startNo = 0; private int m_endNo = 0; private String m_dataType; @@ -173,6 +176,27 @@ public final class ImpFormatRow return m_columnName; } // getColumnName + /** + * Name + * @param Name name + */ + public void setName (String name) + { + if (name == null || name.length() == 0) + throw new IllegalArgumentException("Name must be at least 1 char"); + else + m_name = name; + } // setName + + /** + * Get Name + * @return Name + */ + public String getName() + { + return m_name; + } // getName + /** * Data Type * @param dataType data type - see constants DATATYPE_ diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java index b4d94ced10..af7650c424 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VFileImport.java @@ -391,7 +391,7 @@ public class VFileImport extends CPanel for (int i = 0; i < size; i++) { ImpFormatRow row = m_format.getRow(i); - m_labels[i] = new JLabel (row.getColumnName()); + m_labels[i] = new JLabel (row.getName()); previewPanel.add(m_labels[i], new GridBagConstraints(i, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0)); // diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java index 10c8ae394a..bca58868d2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFileImport.java @@ -480,7 +480,7 @@ public class WFileImport extends ADForm implements EventListener { ImpFormatRow row = m_format.getRow(i); - m_labels[i] = new Label(row.getColumnName()); + m_labels[i] = new Label(row.getName()); Hbox hbox = new Hbox(); hbox.setWidth("100%");