2011-07-19 54 views

回答

0

我發現要求requirement is, for some specific type of field, I want to show selection, for Value field instead of simple text box.

for (DataSourceField field : dataSource.getFields()) { 

    String type = field.getAttribute("serverType"); 

    if (type!=null && type.equals("SPECIFIC_TYPE")) { 

    TreeMap<String, String> map = new TreeMap<String, String>(); 
    map.put("1", "value 1"); 
    map.put("2", "value 2"); 
    field.setValueMap(map); 
    } 
} 
解決方案