Merge 93d03b4db22d

This commit is contained in:
Heng Sin Low 2013-08-05 11:04:54 +08:00
commit 5f38260736
2 changed files with 17 additions and 4 deletions

View File

@ -466,10 +466,12 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
value = ((Object[])value)[0];
}
if (value == null && getValue() == null)
if (value == null && getValue() == null) {
updated = true;
else if (value != null && value.equals(getValue()))
} else if (value != null && value.equals(getValue())) {
updated = true;
getComponent().setText(lookup.getDisplay(value));
}
if (!updated)
{
setValue(value);

View File

@ -35,6 +35,7 @@ import org.adempiere.webui.panel.InfoPaymentPanel;
import org.adempiere.webui.panel.InfoProductPanel;
import org.compiere.model.GridField;
import org.compiere.model.Lookup;
import org.compiere.model.MDocType;
import org.compiere.model.MInfoWindow;
import org.compiere.util.Env;
@ -49,11 +50,12 @@ public class DefaultInfoFactory implements IInfoFactory {
public InfoPanel create(int WindowNo, String tableName, String keyColumn,
String value, boolean multiSelection, String whereClause, int AD_InfoWindow_ID, boolean lookup) {
InfoPanel info = null;
setSOTrxBasedOnDocType(WindowNo);
if (tableName.equals("C_BPartner")) {
info = new InfoBPartnerWindow(WindowNo, tableName, keyColumn, value, multiSelection, whereClause, AD_InfoWindow_ID, lookup);
if (!info.loadedOK()) {
info = new InfoBPartnerPanel (value,WindowNo, !Env.getContext(Env.getCtx(),"IsSOTrx").equals("N"),
info = new InfoBPartnerPanel (value,WindowNo, !Env.getContext(Env.getCtx(), WindowNo, "IsSOTrx").equals("N"),
multiSelection, whereClause, lookup);
}
} else if (tableName.equals("M_Product")) {
@ -123,7 +125,8 @@ public class DefaultInfoFactory implements IInfoFactory {
String keyColumn, String queryValue, boolean multiSelection,
String whereClause, int AD_InfoWindow_ID) {
InfoPanel info = null;
setSOTrxBasedOnDocType(lookup.getWindowNo());
String col = lookup.getColumnName(); // fully qualified name
if (col.indexOf('.') != -1)
@ -182,4 +185,12 @@ public class DefaultInfoFactory implements IInfoFactory {
return null;
}
private void setSOTrxBasedOnDocType(int WindowNo) {
int C_DocType_ID = Env.getContextAsInt(Env.getCtx(), WindowNo, "C_DocType_ID");
if (C_DocType_ID != 0) {
MDocType dt = MDocType.get (Env.getCtx(), C_DocType_ID);
Env.setContext(Env.getCtx(), WindowNo, "IsSOTrx", dt.isSOTrx () ? "Y": "N");
}
}
}