diff --git a/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java b/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java index 18251591d4..0327477f1a 100644 --- a/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java +++ b/org.adempiere.base/src/org/compiere/model/DataStatusEvent.java @@ -20,6 +20,8 @@ import java.io.Serializable; import java.sql.Timestamp; import java.util.EventObject; +import org.idempiere.fa.util.Util; + /** * Data Status Event *
@@ -337,4 +339,17 @@ public final class DataStatusEvent extends EventObject implements Serializable
return m_confirmed;
} // isConfirmed
+ public boolean isEqual(DataStatusEvent e) {
+ if (e == null) return false;
+
+ return e.m_changed == m_changed &&
+ e.m_inserting == m_inserting &&
+ e.m_isError == m_isError &&
+ e.m_isWarning == m_isWarning &&
+ Util.equals(e.m_AD_Message, m_AD_Message) &&
+ e.m_changedColumn == m_changedColumn &&
+ Util.equals(e.m_columnName, m_columnName) &&
+ e.m_currentRow == m_currentRow;
+ }
+
} // DataStatusEvent
diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java
index 3e83e0232e..87f45a2fc0 100644
--- a/org.adempiere.base/src/org/compiere/model/GridTab.java
+++ b/org.adempiere.base/src/org/compiere/model/GridTab.java
@@ -2227,7 +2227,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
* @param e event
*/
public void dataStatusChanged (DataStatusEvent e)
- {
+ {
if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - " + e.toString());
int oldCurrentRow = e.getCurrentRow();
m_DataStatusEvent = e; // save it
@@ -2238,6 +2238,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
// set current row
m_DataStatusEvent = e; // setCurrentRow clear it, need to save again
m_DataStatusEvent.setCurrentRow(m_currentRow);
+
// Same row - update value
if (oldCurrentRow == m_currentRow)
{
@@ -2248,8 +2249,25 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
field.setValue(value, m_mTable.isInserting());
}
}
- else // Redistribute Info with current row info
- fireDataStatusChanged(m_DataStatusEvent);
+ else
+ {
+ // Redistribute Info with current row info
+ // Avoid firing of duplicate event
+ boolean fire = true;
+ if (m_lastDataStatusEvent != null)
+ {
+ if (System.currentTimeMillis() - m_lastDataStatusEventTime < 200)
+ {
+ if (m_lastDataStatusEvent.isEqual(m_DataStatusEvent))
+ {
+ fire = false;
+ }
+ }
+ }
+
+ if (fire)
+ fireDataStatusChanged(m_DataStatusEvent);
+ }
//reset
m_lastDataStatusEventTime = System.currentTimeMillis();
diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java
index be306888f9..b81cdbfc93 100644
--- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Messagebox.java
@@ -28,6 +28,7 @@ import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.zkoss.zhtml.Text;
+import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
@@ -244,7 +245,20 @@ public class Messagebox extends Window implements EventListener
").append(message);
}
return out;