View Full Version : Combo Box and Editor Grid-Retrieve data

7 Dec 2011, 3:16 AM
I have an editor grid with a combo box as one of the columns. I want to retrieve the modified records data from the editor grid.
In my save function the code is as follows:

depcp.addButton(new Button("Save", new SelectionListener<ButtonEvent>() {

public void componentSelected(ButtonEvent ce) {
List<Record> records=depstore.getModifiedRecords();
for(Record r:records)
BaseModelData w = (BaseModelData) r.getModel();
MessageBox.prompt(w.get("table_id").toString(), (String)w.get("table_buf"));

So the modified records correctly show the rows that have been edited. But I get the existing value(I am giving defaults for the combobox) and not the edited value(which the user enters from the dropdown).
How do I get the edited value here? Basically, I should be getting to the store of the combobox and not the grid, right?

I have overridden the combobox preprocess and postprocess as follows:

CellEditor editor = new CellEditor(combo) {
public Object preProcessValue(Object value) {
if (value == null) {
return value;
return combo.getStore().findModel(combo.getDisplayField(), value.toString());


public Object postProcessValue(Object value) {
if (value == null) {
return value;
return ((BaseModelData) value).get(combo.getDisplayField());

My display field is the name and the value field is the id of the underlying basemodel object. I want to be able to get the id of the modified entry in the combobox.
And for the column config I have:


Thanks in advance!