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

Check box column does not check/uncheck correctly #492

Open
Cydoniat opened this issue Oct 18, 2022 · 3 comments
Open

Check box column does not check/uncheck correctly #492

Cydoniat opened this issue Oct 18, 2022 · 3 comments
Milestone

Comments

@Cydoniat
Copy link

Cydoniat commented Oct 18, 2022

Hello everyone!

We've encountered a pretty boring problem and for some days now we haven't been able to solve it. To give a bit of background, we have a Nebula NatTable with 5 columns, where the last one should be a a column containing simple check boxes. We have followed this tutorial: https://www.vogella.com/tutorials/NatTableEditing/article.html. However, the problem we have is with actual clicking on the cell. If you just click on it, it doesn't change the state. However, if the cell is selected and you then push the space bar, the tick does (dis)appear and the underlying command is triggered. Here's the configuration we have so far:
`public class CheckBoxConfigurationNebula extends AbstractRegistryConfiguration {

@Override
public void configureRegistry(final IConfigRegistry configRegistry) {

	configRegistry.registerConfigAttribute(
			EditConfigAttributes.CELL_EDITABLE_RULE,
			IEditableRule.ALWAYS_EDITABLE
			);

	registerCheckBoxEditor(configRegistry);
}

private static void registerCheckBoxEditor(final IConfigRegistry configRegistry) {

	configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new CheckBoxCellEditor(),
			DisplayMode.EDIT, NatTableWidgetFactory.VISIBILITY_CELL);

	// Visualized as a check box button
	configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
			new CheckBoxPainter(),
			DisplayMode.NORMAL, NatTableWidgetFactory.VISIBILITY_CELL);

	// Needs a Boolean conversion to work correctly
	configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER,
			new DefaultBooleanDisplayConverter(), DisplayMode.NORMAL, NatTableWidgetFactory.VISIBILITY_CELL);
}

}`

Do you have an idea what could be the problem?

@fipro78
Copy link
Contributor

fipro78 commented Oct 18, 2022

I'm not sure if I understand correctly. Do you expect that the checkbox state changes when you click in the cell even if you don't hit the checkbox? Or is it something different?

Btw, although NatTable is a subproject of Nebula it has its own repository and forum. I wasn't able to migrate it to GitHub so far.

@Cydoniat
Copy link
Author

I see my mistake, I said cell but meant the check box inside of it. The tick doesn't (dis)appear even in any case - neither when clicking exactly on the check box nor on the cell. The only thing that works is selecting the cell and ten hitting the space bar.

Should I move the question to the other forum?

@fipro78
Copy link
Contributor

fipro78 commented Oct 19, 2022

Well, if the checkbox state change works on key press but not on click, I suppose you are missing the necessary ui bindings. The tutorial you are referring to is not covering this fact, as it simply uses a GridLayer that has the necessary configurations already included by default. If you are not using a GridLayer with the default configuration enabled, the necessary mouse bindings are missing.

The following page should cover it at least basically: https://www.eclipse.org/nattable/documentation.php?page=editing

Of course I don't know if you are using a GridLayer like the tutorial or if you are using another composition. Or if you changed the configuration in any way, as you did not share your layer composition. So I can only guess, but typically the described behavior results from missing or incorrectly registered ui binding configurations.

Should I move the question to the other forum?

If it is necessary to have a longer discussion yes.

@lcaron lcaron added this to the 3.1.0 milestone Mar 7, 2023
@lcaron lcaron modified the milestones: 3.1.0, 3.2.0, 3.1.1 Dec 23, 2023
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

No branches or pull requests

3 participants