Browse Source

Pull request #3111: CHART-17231 默认不选中任何项

Merge in DESIGN/design from ~ZHENG/c-design:final/10.0 to final/10.0

* commit 'eaeffb57140b57bdcb0ed2edee5b37dd927f46bb':
  CHART-17231 默认不选中任何项
final/10.0
Kara 4 years ago
parent
commit
e721b210ab
  1. 6
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

6
designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

@ -23,7 +23,11 @@ public class UIComboBoxWithNone extends UIComboBox {
} }
protected void setDefaultSelectedItem() { protected void setDefaultSelectedItem() {
setSelectedItem(StringUtils.EMPTY); // JComboBox.setSelectedItem(o)
// if(o!=null)寻找o对应的下拉选项 如果找不到 还是选中之前选中的
// 所以空字符串 不是选中空 是选中上次选中的
// 所以这边 可以写setSelectedItem(null) or setSelectedIndex(-1)
setSelectedIndex(-1);
} }
@Override @Override

Loading…
Cancel
Save