Addon Discussion - IndeterminateCheckBox

Since I could not find a Vaadin 7 addon for this functionality, I decided to create it myself. A CheckBox with 3 different states, True, False and Indeterminate.


https://vaadin.com/directory#!addon/indeterminatecheckbox

Bugs can be reported here or at github (github preferred)


https://github.com/snyholm/indeterminatecheckbox/issues

There is this poorly named addon:
https://vaadin.com/directory#!addon/lognetwidgetset
which I’ve been using. It has a bug in firing a change event but I managed to work around it by extending and overriding the setValue() method.

Yours looks good. I tried using your addon but got build errors due to JDK version incompatibility. I’ve created an issue.

Thanks for trying it out and letting me know! I have uploaded a new version using Java 7 to build the project so hopefully you should be able to get everything up and running. If you feel like trying it out again and updating your rating accordingly, I would appreciate it.

Thanks for updating it. It builds fine now but I found another issue.

I don’t know if this is intentional or a bug, but you can not go back to an indeterminate state by clicking the checkbox. It is customary for tri-state check boxes to go:
Indeterminate->checked->Unchecked->Indeterminate->checked->…

but right now your checkbox goes:
Indeterminate->checked->Unchecked->checked->…

which means you can only set the indeterminate state programmatically.

It was intentional, mainly due to the fact that there’s the conceptual issue of a user setting the state to be indeterminate, what does that actually mean ? Can you give me a usecase for this ? I could add it if it’s needed.

It means “I don’t care” or “don’t change”

I use indeterminate check in 2 use cases:

  1. In a binary filter context. The user is setting whether a bit should be 1, 0, or “don’t care” for the filter to pass.

  2. In a selection tree during import/export. This is commonly used. For example, I’ve attached an image of the export to jar dialog in Eclipse.

21904.png

Hi Sebastian!
Thanks for sharing this addon!
I am also in the need of the three-state succession as described by Iyad.
I am thinking of using the addon in a binary filter where checked would mean bring me all the active users, unchecked would mean bring me all the non-active users and indetermined would mean bring me both.
I believe that a tri-state checkbox would be ideal for this functionality, but any other ideas would be appreciated.

Thank you for your comment. I’m actually in the process of adding the feature to select if the user should be able to toggle the third state, to the checkbox. I should hopefully be able to update the addon this week with that functionality.

That would be great! Thank you!

The addon has now been updated to 2.0 which supports allowing the user to select the state. Sorry for the delay, was quite busy and ran into quite a few issues in trying to get it to work properly.

Trying to use this addon again. There are a couple of issues I found. See attached screenshot for illustration of both:

  1. Everytime the user toggles the checkobox the styles list associated with the checkbox grows by an extra “v-indeterminate-checkbox” style (or, as in image, an extra replicaiton of the set of styles). It is harmless I think but a bug nonetheless.
  2. The icon for “Indeterminate” is initially correct “-”, but then turns into an undefined box.

For whatever’s worth, I see problem#2 with the other TriStateCheckbox addon as well (which is what brought me back to try to use your addon instead). So it may be related to a change in FontAwesome icons or some other external module.
33112.png

Hi,
Your checkbox is very useful but I found an error using it. If it placed on a form in disabled state, mouse click on it makes it “checked” but its’ value does not change.
Would you fix the error yourself or suggest me how to do it?
Thanks.