Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSDataGrid ComboBox Issue with duplicate entries #126

Open
bpangburn opened this issue Mar 19, 2022 · 1 comment · Fixed by #174
Open

SSDataGrid ComboBox Issue with duplicate entries #126

bpangburn opened this issue Mar 19, 2022 · 1 comment · Fixed by #174

Comments

@bpangburn
Copy link
Owner

In SwingSet Demo, Example 6. Part #3 and #4 are both "Screw"

If you open Example 7 and look at the logging, it appears to be impossible to select the 2nd instance of "Screw". If you give a unique name to Part #4, the problem goes away.

Per @prasanthreddy-git :

If you have a same name for two items in a combo, I think you can't select the second one. This is an issue with JComboBox...Probably we should change that to SSComboBox.

Per @errael:

Yeah, I've heard that Jcombo inside Jtable is notoriously problematic with event handling, needing multiple clicks is the one I remember, but I think there's more. I vaguely recall that glazed said they could handle that better...JCombo uses .equals, not ==. Workaround is to wrap the string in a class that doesn't override equals.

Sounds like the best fix is to try to replace JComboBox with SSComboBox.

errael added a commit that referenced this issue Feb 19, 2023
use SimpleComboListSwingModes. Issue #126
Fix save/restore sorting state issues.
@errael errael linked a pull request Dec 30, 2023 that will close this issue
@bpangburn
Copy link
Owner Author

bpangburn commented Nov 4, 2024

I think the key handling is different for datagrids vs forms, but just to note it, if we ever need to isolate keystrokes inside of a combobox inside of a grid, we might have to isolate the EditorComponent. Ran into an issue where we had some F1 system "help" (not internal to SwingSet) that was supposed to open a URL, but ceased to work on SwingSet 4.x comboboxes as the F1 keystroke was not detected.

In SwingSet 4.x the comboboxes (SSComboBox and SSDBComboBox) are (almost?) always in editor mode so to detect the F1 key (or any other key), we need to place the KeyListeners on the EditorComponent using:
someSSComboBox.getEditor().getEditorComponent();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant