Skip to main content



      Home
Home » Eclipse Projects » NatTable » ComboBox Multiselect/Use Checkbox question
ComboBox Multiselect/Use Checkbox question [message #1772689] Wed, 13 September 2017 17:30 Go to next message
Eclipse UserFriend
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 18:04 Go to previous messageGo to next message
Eclipse UserFriend
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 19:56 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: ComboBox Multiselect/Use Checkbox question [message #1801607 is a reply to message #1772694] Wed, 23 January 2019 07:05 Go to previous message
Eclipse UserFriend
Hello,

Can you please share steps to change combo box such that user can select multiple values using checkbox present in combo box drop down ?
Previous Topic:Font color for a substring in a cell
Next Topic:How to disable the empty vertical scrollbar painting
Goto Forum:
  


Current Time: Wed May 14 18:26:57 EDT 2025

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

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

Back to the top