From ae59e247c0bc957f4263c9f95b410067e77bb913 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 26 Mar 2011 01:35:42 -0500 Subject: [PATCH] Detected a big bug (leading to data corruption) in swing client on WFActivity - user push OK button twice and the document is closed (completed with the first click, and closed with the second click) - reproducible in GardenWorld via swing with requisition workflow --- .../src/org/compiere/apps/wf/WFActivity.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java index f1937bcb8b..bfdbf56de2 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/wf/WFActivity.java @@ -184,9 +184,9 @@ public class WFActivity extends CPanel */ private void dynInit(int WindowNo) { - loadActivities(); // Forward fForward = VLookup.createUser(WindowNo); + loadActivities(); } // dynInit /** @@ -434,6 +434,7 @@ public class WFActivity extends CPanel */ public int loadActivities() { + resetDisplay(null); while (selTableModel.getRowCount() > 0) selTableModel.removeRow(0); long start = System.currentTimeMillis(); @@ -591,7 +592,8 @@ public class WFActivity extends CPanel m_activity = null; m_column = null; - m_activity = new MWFActivity(Env.getCtx(),id.getRecord_ID(),null); + if (id != null) + m_activity = new MWFActivity(Env.getCtx(),id.getRecord_ID(),null); if (m_activity == null) { @@ -632,8 +634,11 @@ public class WFActivity extends CPanel // if (e.getSource() == bZoom) cmd_zoom(); - else if (e.getSource() == bOK) + else if (e.getSource() == bOK) { + bOK.setEnabled(false); cmd_OK(); + bOK.setEnabled(true); + } else if (e.getSource() == fAnswerButton) cmd_button(); //