IDEMPIERE-245 Fix problem reported by Nicolas about Memo fields

This commit is contained in:
Carlos Ruiz 2012-06-24 00:32:01 -05:00
parent 11583224a9
commit b42fe550f7
1 changed files with 7 additions and 7 deletions

View File

@ -57,7 +57,7 @@ public class VMemo extends CTextArea
/** /**
* *
*/ */
private static final long serialVersionUID = -1589654941310687511L; private static final long serialVersionUID = -7168406072766858933L;
/** /**
* Mouse Listener * Mouse Listener
@ -156,7 +156,7 @@ public class VMemo extends CTextArea
private String m_columnName; private String m_columnName;
private String m_oldText = ""; private String m_oldText = "";
private boolean m_firstChange; private volatile boolean m_setting = false;
/** Logger */ /** Logger */
private static CLogger log = CLogger.getCLogger(VMemo.class); private static CLogger log = CLogger.getCLogger(VMemo.class);
@ -167,7 +167,8 @@ public class VMemo extends CTextArea
public void setValue(Object value) public void setValue(Object value)
{ {
super.setValue(value); super.setValue(value);
m_firstChange = true; if (m_setting)
return;
// Always position Top // Always position Top
setCaretPosition(0); setCaretPosition(0);
} // setValue } // setValue
@ -266,14 +267,13 @@ public class VMemo extends CTextArea
*/ */
public void focusLost (FocusEvent e) public void focusLost (FocusEvent e)
{ {
// Indicate Change m_setting = true;
log.fine( "focusLost");
try try
{ {
String text = getText(); fireVetoableChange(m_columnName, m_oldText, getText());
fireVetoableChange(m_columnName, text, null); // No data committed - done when focus lost !!!
} }
catch (PropertyVetoException pve) {} catch (PropertyVetoException pve) {}
m_setting = false;
} // focusLost } // focusLost
/*************************************************************************/ /*************************************************************************/