diff --git a/client/src/org/compiere/grid/GridController.java b/client/src/org/compiere/grid/GridController.java index 78afb75498..fb6f20f741 100644 --- a/client/src/org/compiere/grid/GridController.java +++ b/client/src/org/compiere/grid/GridController.java @@ -535,9 +535,7 @@ public class GridController extends CPanel // Enable Button actions in grid if (mField.getDisplayType () == DisplayType.Button) { - VEditor button = ce.getEditor (); - if (button != null && aPanel != null) - ((JButton)button).addActionListener (aPanel); + ce.setActionListener(aPanel); } } else // column not displayed diff --git a/client/src/org/compiere/grid/ed/VCellEditor.java b/client/src/org/compiere/grid/ed/VCellEditor.java index 84362ffdac..3bfd635b59 100644 --- a/client/src/org/compiere/grid/ed/VCellEditor.java +++ b/client/src/org/compiere/grid/ed/VCellEditor.java @@ -24,6 +24,7 @@ import javax.swing.*; import javax.swing.table.*; import org.adempiere.plaf.AdempierePLAF; +import org.compiere.apps.APanel; import org.compiere.model.*; import org.compiere.util.*; @@ -60,6 +61,8 @@ public final class VCellEditor extends AbstractCellEditor private VEditor m_editor = null; /** Table */ private JTable m_table = null; + private ActionListener buttonListener; + private ActionListener actionListener; /** ClickCount */ private static int CLICK_TO_START = 1; /** Logger */ @@ -203,7 +206,8 @@ public final class VCellEditor extends AbstractCellEditor public void actionPerformed (ActionEvent e) { log.finer(m_mField.getColumnName() + ": Value=" + m_editor.getValue()); -// super.stopCellEditing(); // causes VLookup.Search Text not to work + if (e.getSource() == m_editor && actionListener != null) + actionListener.actionPerformed(e); } // actionPerformed /** @@ -236,4 +240,7 @@ public final class VCellEditor extends AbstractCellEditor } } + public void setActionListener(ActionListener listener) { + actionListener = listener; + } } // VCellEditor