question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CheckComboBox ListChangeListener fires off twice after selection change

See original GitHub issue

Original report by FanFeeds (Bitbucket: user3822, GitHub: Unknown).


I’m using a custom ControlsFX that has Pull Request #677 which adds the ability to click on the label next to the checkbox in order to select the item.

After some testing, I believe it comes down to the changes made in this pull request, and I’ll explain why.

Here’s what my test code looks like:

#!java

checkComboBox.getCheckModel().getCheckedItems().addListener(new ListChangeListener<String>() {
    @Override
    public void onChanged(ListChangeListener.Change<? extends String> c) {
        while (c.next()){
            System.out.println("test");
        }
    }
});       

After a few hours of testing, I found out that if I click directly on the checkbox, it only fires off once. But if I click on the label to the right of the checkbox, it fires off twice.

I also created a separate project with the publicly available ControlsFX and tried it out. It works properly (which, considering my previous testing, it should work properly because the label on the right cannot be clicked in order to select the checkbox).

Put it all together, and I think the culprit lies somewhere in the changes made in Pull Request #677.

Happy Holidays and take care, everyone!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
hink084commented, Nov 5, 2020

This is still a bug in v11.0.3. I am unable to find the referenced PR’s associated with this issue.

1reaction
lsh-0commented, Jan 27, 2022

thanks to @JonathanGiles for investigating the problem and raising this ticket, I’m seeing this behaviour too in 11.1.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bountysource
CheckComboBox ListChangeListener fires off twice after selection change.
Read more >
java - Set ComboBox to read only without disabling the ...
Subclass SingleSelectionModel , create a ReadOnlySingleSelectionModel . Upon switching to read-only mode, replace the default selection model ...
Read more >
CheckComboBox (ControlsFX Project 8.40.16) - javadoc.io
A simple UI control that makes it possible to select zero or more items within a ComboBox-like control. Each row item shows a...
Read more >
CheckComboBox (ControlsFX Project 11.0.3)
The following screenshot shows the CheckComboBox with some sample data: ... relevant events (e.g. when the selected indices or // selected items change)....
Read more >
Index (com.iamsoft:iamsoft-fxutils 8.0.1-SNAPSHOT API)
Adjusts internal indices after calling super implementation. ... Gets an observable which fires events when the table selection changes because of an 'find' ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found