Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ComboBox Multiselect/Use Checkbox question
ComboBox Multiselect/Use Checkbox question [message #1772689] Wed, 13 September 2017 21:30 Go to next message
Louis Detweiler is currently offline Louis DetweilerFriend
Messages: 57
Registered: August 2017
Member
Hello,

I am implementing a NatTable and would like to use the multiselect with checkboxes feature of a combo box cell editor. However, when doing so, it currently does not pre-select the items that are already in the cell when opening the combo box, like it does in the example. So, it clears all items in the cell whenever the combo box is opened.

I think it has something to do with the data model we're using behind the NatTable.

I've been trying to debug to see where the combo box gets the items to be preselected but haven't gotten anywhere.

If you could give me a hint as to where/how the combo box gets the items to be preselected that would be very helpful.

Thanks so much,

Louis
Re: ComboBox Multiselect/Use Checkbox question [message #1772690 is a reply to message #1772689] Wed, 13 September 2017 22:04 Go to previous messageGo to next message
Louis Detweiler is currently offline Louis DetweilerFriend
Messages: 57
Registered: August 2017
Member
I think I found it. Is it in NatCombo's setDropdownSelection method?
Re: ComboBox Multiselect/Use Checkbox question [message #1772694 is a reply to message #1772690] Wed, 13 September 2017 23:56 Go to previous message
Louis Detweiler is currently offline Louis DetweilerFriend
Messages: 57
Registered: August 2017
Member
I have solved the issue. For those who in the future may have a similar problem, the solution for me was as follows.

I had changed what is displayed in the ComboBox to be substrings of what is actually contained in the cell. When the combo box checks for things that are already displayed however, it compares what is in the cell to what is shown in the ComboBox, which makes sense. Therefore, nothing matched in my case, so it didn't preselect anything when the ComboBox was displayed.

My solution was to override the setSelection method of the NatCombo when it is created in the createEditorControl method of the ComboBoxCellEditor. I intercepted the "items" string array that is passed into the setDropdownSelection method and changed it to contain the strings as they are displayed in my ComboBox.

Best,

Louis
Previous Topic:Question about TableCellPainter subcell selection/editing
Next Topic:TableCellPainter trouble
Goto Forum:
  


Current Time: Sat Sep 22 05:53:54 GMT 2018

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

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

Back to the top