PDA

View Full Version : [CLOSED] [1.2.3] Problem using ComboBox as an editor in the grid



micgala
10 Mar 2009, 5:48 AM
Hi.

While using a ComboBox as an editor in the EditorGrid, a ClassCastException occurs in this line:

(Editor.java - startEdit method)

field.setValue(preProcessValue(value));

My guess is that, when using ComboBox, we should assign the value using setRawValue.

So it would be like this:

if (field instanceof ComboBox) {
field.setRawValue(preProcessValue(value));
} else {
field.setValue(preProcessValue(value));
}

Is someone able to recreate this?

Regards,
Michel.

sven
10 Mar 2009, 5:58 AM
This is no bug. You should use the help forum and you should also check the examples how to handle comboboxes in editors.

micgala
10 Mar 2009, 7:15 AM
Hi.

You are right, sorry about that, my mistake.

Just in case, if someone else stops here and is having the same problem as me, just override the preProcessValue and postProcessValue methods of the CellEditor class and return your model.

Regards,
Michel.

altmayer
9 May 2011, 1:23 AM
Hi,

I have got general problems with correctly implementing the preProcessValue and postProcessValue methods.
How are those to be implemented? The examples I found only had a SIMPLEComboBox but not ComboBox<D> with an own BaseModelData D.