* Merge revisions 6398 from branches/adempiere341

This commit is contained in:
Heng Sin Low 2008-09-10 05:38:25 +00:00
parent cb40da8cc6
commit a67d22109e
3 changed files with 17 additions and 10 deletions

View File

@ -63,6 +63,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
private String columnName;
private WEditorPopupMenu popupMenu;
private Object value;
private InfoPanel infoPanel = null;
private static CLogger log = CLogger.getCLogger(WSearchEditor.class);
@ -269,6 +270,11 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
}
else if (WEditorPopupMenu.NEW_EVENT.equals(evt.getContextEvent()))
{
if (infoPanel != null)
{
infoPanel.detach();
infoPanel = null;
}
actionBPartner(true);
}
}
@ -477,6 +483,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
ip.setClosable(true);
ip.setAttribute("mode", "modal");
ip.addValueChangeListener(this);
infoPanel = ip;
AEnv.showWindow(ip);
}
else if (col.equals("C_BPartner_ID"))
@ -498,6 +505,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
ip.setClosable(true);
ip.setAttribute("mode", "modal");
ip.addValueChangeListener(this);
infoPanel = ip;
AEnv.showWindow(ip);
/*
@ -524,6 +532,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
ig.setClosable(true);
ig.setAttribute("mode", "modal");
ig.addValueChangeListener(this);
infoPanel = ig;
AEnv.showWindow(ig);
cancelled = ig.isCancelled();
@ -531,6 +540,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
}
infoPanel = null;
// Result
if (result != null)
{

View File

@ -168,6 +168,8 @@ ContextMenuListener, IZoomableEditor
if (selItem != null)
{
retVal = selItem.getValue();
if ((retVal instanceof Integer) && (Integer)retVal == -1)
retVal = null;
}
return retVal;
}

View File

@ -43,6 +43,7 @@ import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
@ -379,19 +380,13 @@ public class WBPartner extends Window implements EventListener, ValueChangeListe
// Check Mandatory fields
if (fName.getText().equals(""))
{
fName.setStyle(BackgroundColours.ERROR);
return false;
throw new WrongValueException(fName, Msg.translate(Env.getCtx(), "FillMandatory"));
}
else
fName.setStyle(BackgroundColours.MANDATORY);
if (fAddress.getC_Location_ID() == 0)
{
//fAddress.setBackground(Color)(BackgroundColours.ERROR);
return false;
throw new WrongValueException(fAddress.getComponent(), Msg.translate(Env.getCtx(), "FillMandatory"));
}
//else
//fAddress.setBackground(AdempierePLAF.getFieldBackground_Mandatory());
// ***** Business Partner *****
@ -421,7 +416,7 @@ public class WBPartner extends Window implements EventListener, ValueChangeListe
m_partner.setName2(fName2.getText());
ListItem listitem = fGreetingBP.getSelectedItem();
KeyNamePair p = (KeyNamePair)listitem.getValue();
KeyNamePair p = listitem != null ? (KeyNamePair)listitem.getValue() : null;
if (p != null && p.getKey() > 0)
m_partner.setC_Greeting_ID(p.getKey());
@ -467,7 +462,7 @@ public class WBPartner extends Window implements EventListener, ValueChangeListe
m_user.setTitle(fTitle.getText());
listitem = fGreetingC.getSelectedItem();
p = (KeyNamePair)listitem.getValue();
p = listitem != null ? (KeyNamePair)listitem.getValue() : null;
if (p != null && p.getKey() > 0)
m_user.setC_Greeting_ID(p.getKey());