Browse Source

REPORT-52087 单元格元素数据列中首次修改字符不会生效

bugfix/10.0
kuangshuai 4 years ago
parent
commit
b9dea20834
  1. 12
      designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java

12
designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java

@ -55,15 +55,19 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
@Override
public void setSelectedItem(Object anObject) {
initialSelected = anObject;
if (loaded) {
super.setSelectedItem(anObject);
} else {
if (initialSelected == null) {
this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject}));
}
this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject}));
super.setSelectedItem(anObject);
}
}
private void setSelectedItemWithDocumentChange(Object anObject) {
initialSelected = anObject;
super.setSelectedItem(anObject);
}
@Override
@ -185,7 +189,7 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
}
filtering = true;
String xx = textField.getText();
LazyComboBox.this.setSelectedItem(xx);
LazyComboBox.this.setSelectedItemWithDocumentChange(xx);
this.item = textField.getText();
setPopupVisible(true);

Loading…
Cancel
Save