ComboBoxCellEditor can't save custom input value [message #1753251] |
Fri, 03 February 2017 00:42  |
Eclipse User |
|
|
|
Hello Experts,
I tried to use nattable to develop a csv import program.
This is how I declare the bodylayer
TableDataProvider tData = new TableDataProvider();
IDataProvider bodyDataProvider = tData;
AutomaticSpanningDataProvider spanningDataProvider = new AutomaticSpanningDataProvider(bodyDataProvider, true, false);
SpanningDataLayer bodyDataLayer = new SpanningDataLayer(spanningDataProvider);
You can check the screenshot, row 2 shows the name of data, user can pick a name from the combobox or input a custom one. If the user pick the name from dropdown list, the change will be saved, not if the user input custom value, after
press enter nothing happen. I have try to change the edit rule to make every cell
always editable, and other text cell can save the change too.
And here is the code I use to set the combo cells
ComboBoxCellEditor cBox = new ComboBoxCellEditor(Arrays.asList(temp_line));
cBox.setFreeEdit(true);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, cBox, DisplayMode.NORMAL, CONFIG_LABEL_COMBO+cIndex);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new ComboBoxPainter(), DisplayMode.NORMAL, CONFIG_LABEL_COMBO+cIndex);
Thanks for the help.
Attachment: shot1.png
(Size: 20.71KB, Downloaded 166 times)
|
|
|
|
|
Re: ComboBoxCellEditor can't save custom input value [message #1753604 is a reply to message #1753574] |
Wed, 08 February 2017 02:33  |
Eclipse User |
|
|
|
I really can't tell. Typically I would suppose that something with the commit is not working. Either because of conversion or validation failures. Or the datatype does not match the backing bean. But this should be visible in the console or the log. Try to debug in AbstractCellEditor#commit(MoveDirectionEnum, boolean, boolean) to find out more.
|
|
|
Powered by
FUDForum. Page generated in 0.15573 seconds