From 5d75884ae7e5dbbbed9a58a1a281e4190729e388 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 15 Aug 2008 17:30:00 +0000 Subject: [PATCH] Fix [ 2053140 ] Mandatory lookup fields autofilled (badly) --- base/src/org/compiere/model/Lookup.java | 31 +++++++++++++++---------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/base/src/org/compiere/model/Lookup.java b/base/src/org/compiere/model/Lookup.java index c0fbf583e1..87472af76e 100644 --- a/base/src/org/compiere/model/Lookup.java +++ b/base/src/org/compiere/model/Lookup.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Product: Adempiere ERP & CRM Smart Business Solution * + * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * @@ -16,10 +16,16 @@ *****************************************************************************/ package org.compiere.model; -import java.io.*; -import java.util.*; -import javax.swing.*; -import org.compiere.util.*; +import java.io.Serializable; +import java.util.ArrayList; + +import javax.swing.AbstractListModel; +import javax.swing.MutableComboBoxModel; + +import org.compiere.util.CLogger; +import org.compiere.util.KeyNamePair; +import org.compiere.util.NamePair; +import org.compiere.util.ValueNamePair; /** * Base Class for MLookup, MLocator. @@ -277,14 +283,15 @@ public abstract class Lookup extends AbstractListModel obj = m_selectedObject; } + // comment next code because of bug [ 2053140 ] Mandatory lookup fields autofilled (badly) // if nothing selected & mandatory, select first - if (obj == null && mandatory && p_data.size() > 0) - { - obj = p_data.get(0); - m_selectedObject = obj; - log.finest(getColumnName() + ": SelectedValue SetToFirst=" + obj); - // fireContentsChanged(this, -1, -1); - } + // if (obj == null && mandatory && p_data.size() > 0) + // { + // obj = p_data.get(0); + // m_selectedObject = obj; + // log.finest(getColumnName() + ": SelectedValue SetToFirst=" + obj); + // // fireContentsChanged(this, -1, -1); + // } m_loaded = true; fireContentsChanged(this, 0, p_data.size());