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);
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);