Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ComboBoxCellEditor can't save custom input value
ComboBoxCellEditor can't save custom input value [message #1753251] Fri, 03 February 2017 05:42 Go to next message
Mark Huang is currently offline Mark HuangFriend
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)
Re: ComboBoxCellEditor can't save custom input value [message #1753573 is a reply to message #1753251] Tue, 07 February 2017 19:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2903
Registered: July 2012
Senior Member
Can't tell anything with the given information. Sounds like the commit is not possible. Check the console for exceptions.
Re: ComboBoxCellEditor can't save custom input value [message #1753574 is a reply to message #1753573] Tue, 07 February 2017 19:14 Go to previous messageGo to next message
Mark Huang is currently offline Mark HuangFriend
Messages: 2
Registered: February 2017
Junior Member
Thanks for reply.
I have found when select the name from dropdown list, the comboboxcell editor called the setDataValue method of data provider to save the value, but it won't be trigger by custom input. Is there any reason could cause the comboboxcelleditor didn't fire the update data command when the input value isn't from combo list?

Is there any information I could provide to help you? I didn't get any error message or exception in console.

Thank you.
Re: ComboBoxCellEditor can't save custom input value [message #1753604 is a reply to message #1753574] Wed, 08 February 2017 07:33 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2903
Registered: July 2012
Senior Member
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.
Previous Topic:Focus is not coming out of custom cell editor.
Next Topic:nebula nattable vs swt table deferences
Goto Forum:
  


Current Time: Thu Sep 26 21:00:07 GMT 2024

Powered by FUDForum. Page generated in 0.04362 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top