Desktop: Fix PickerField clear action

This commit is contained in:
Yuriy Artamonov 2011-07-27 13:08:41 +00:00
parent 2a3bbb06bf
commit c211388a14

View File

@ -16,7 +16,6 @@ import com.haulmont.cuba.desktop.sys.vcl.Picker;
import com.haulmont.cuba.gui.components.Action; import com.haulmont.cuba.gui.components.Action;
import com.haulmont.cuba.gui.components.CaptionMode; import com.haulmont.cuba.gui.components.CaptionMode;
import com.haulmont.cuba.gui.components.PickerField; import com.haulmont.cuba.gui.components.PickerField;
import com.haulmont.cuba.gui.components.ValidationException;
import com.haulmont.cuba.gui.data.Datasource; import com.haulmont.cuba.gui.data.Datasource;
import com.haulmont.cuba.gui.data.impl.DsListenerAdapter; import com.haulmont.cuba.gui.data.impl.DsListenerAdapter;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
@ -132,13 +131,12 @@ public class DesktopPickerField
public void setValue(Object value) { public void setValue(Object value) {
if (!ObjectUtils.equals(prevValue, value)) { if (!ObjectUtils.equals(prevValue, value)) {
if (datasource == null) { if (datasource == null) {
if (!ObjectUtils.equals(prevValue, value)) fireChangeListeners();
fireValueChanged(prevValue, value);
} else { } else {
datasource.getItem().setValue(metaProperty.getName(), value); datasource.getItem().setValue(metaProperty.getName(), value);
} }
updateText(value);
} }
updateText(value);
} }
@Override @Override