在listui的onload的方法中添加
@Override
public void onLoad() throws Exception {
this.menuItemSwitchView.setVisible(true); //会在列表的查看菜单显示
this.menuItemSwitchView.setEnabled(true);
this.menuItemSwitchView.setSelected(true);
super.onLoad();
List headQueryFields = getHeadQueryFiledNames();
String[] headFielNames = new String[headQueryFields.size()];
SelectorItemCollection selector2 = this.getMainQuery().getSelector();
this.getMainQuery().setSelector(selector2);
this.getMainQuery().setRemoveEntry(true);
this.getMainTable().putBindContents("mainQuery", headFielNames);
}
//获取表头字段
public List getHeadQueryFiledNames() {
List headQueryFields = new ArrayList();
try {
String[] fieldCollection = getQueryInfo().getHeaderSelectorFields();
if (fieldCollection != null) {
for (int index = 0; index < fieldCollection.length; ++index) {
headQueryFields.add(fieldCollection[index].toUpperCase());
}
}
} catch (Exception e) {
logger.error(e);
}
return headQueryFields;
}