smartgwt

example to override getValueFieldProperties FilterBuilder


I want to override getValueFieldProperties for FilterBuilde. My requirement is for some specific type of field I want to show selection, for Value field instead of simple text box. I have visited following: http://code.google.com/p/smartgwt/source/browse/tags/2.5/main/src/com/smartgwt/client/widgets/form/FilterBuilder.java?r=1796

thanks.


Solution

  • I found the solution for the requirement 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);
        }
    }