ComboBoxCellEditor can't save custom input value [message #1753251] |
Fri, 03 February 2017 05:42 |
Mark Huang Messages: 2 Registered: February 2017 |
Junior Member |
|
|
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 134 times)
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04362 seconds