Browse Source

Merge pull request #138 in BA/design from ~XIAOHU/design:dev to dev

* commit 'b6935458f585bcb44ab2919453434c38554d8cc6':
  update
  重新初始化列名
master
superman 9 years ago
parent
commit
38ff516481
  1. 5
      designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java

5
designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java

@ -13,6 +13,8 @@ import com.fr.stable.StringUtils;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.*;
import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
/** /**
@ -35,6 +37,9 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList();
columnNames = new String[nameList.size()];
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames);
columnNameComboBox.removeAllItems(); columnNameComboBox.removeAllItems();
for (int i = 0; i < columnNames.length; i++) { for (int i = 0; i < columnNames.length; i++) {

Loading…
Cancel
Save