Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Grid in SelectItem

$
0
0
hi,

I have a selectItem, which is populating through map
I want to show the map values (Kay , value) as a listgrid , Can anyone suggest the proper approach.

I am followig this aaproach, still dint work

LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();

String code = "code";
String value= "value";

valueMap.put(code , value);


SelectItem codi = new SelectItem();

ListGridField codice = new ListGridField("code","NAme");
ListGridField value= new ListGridField("value","Value");

RecordList dataList = new RecordList();

Iterator entries = map.entrySet().iterator();
while (entries.hasNext()) {
Entry thisEntry = (Entry) entries.next();
Object key = thisEntry.getKey();
Object value = thisEntry.getValue();
Record rec = new Record();
rec.setAttribute("value", value);
rec.setAttribute("code", code);

dataList.add(rec);


}
codi .setValue(dataList);

codi .setPickListFields(codice, value);

Viewing all articles
Browse latest Browse all 4756

Latest Images

Trending Articles



Latest Images