Peer review [2991251] Attachment handle replacements

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2991251
This commit is contained in:
Carlos Ruiz 2010-05-13 23:53:00 +00:00
parent 02c66f361f
commit c2fb126252
2 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,7 @@ public class MAttachment extends X_AD_Attachment
this (ctx this (ctx
, MAttachment.get(ctx, AD_Table_ID, Record_ID) == null ? 0 : MAttachment.get(ctx, AD_Table_ID, Record_ID).get_ID() , MAttachment.get(ctx, AD_Table_ID, Record_ID) == null ? 0 : MAttachment.get(ctx, AD_Table_ID, Record_ID).get_ID()
, trxName); , trxName);
if (MAttachment.get(ctx, AD_Table_ID, Record_ID) == null) { if (get_ID() == 0) {
setAD_Table_ID (AD_Table_ID); setAD_Table_ID (AD_Table_ID);
setRecord_ID (Record_ID); setRecord_ID (Record_ID);
} }

View File

@ -387,6 +387,7 @@ public class WAttachment extends Window implements EventListener
{ {
if (m_change) if (m_change)
{ {
m_attachment.setBinaryData(new byte[0]); // ATTENTION! HEAVY HACK HERE... Else it will not save :(
m_attachment.setTextMsg(text.getText()); m_attachment.setTextMsg(text.getText());
m_attachment.save(); m_attachment.save();
} }