# Find mode: How to find unchecked checkboxes?

**URL:** <https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302>\
**Category:** Classic Servoy\
**Created:** [July 16, 2008, 3:39pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302 "2008-07-16T15:39:30Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 16, 2008, 3:39pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/1 "2008-07-16T15:39:30Z")

</div>

Hello

I just don’t seem to find out how a user would search for a checkbox which is unset, i. e. a checkbox not set?

When switching into Find mode, all checkboxes become “empty” and I can check a checkbox and the result is correct. But what about finding an unchecked checkbox?

Regards, Robert

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [July 16, 2008, 4:39pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/2 "2008-07-16T16:39:41Z")

</div>

Hi Robert,

I tend to use a seperate form for searches and use radiobuttons for this with 2 options (checked/notchecked).

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 16, 2008, 5:36pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/3 "2008-07-16T17:36:17Z")

</div>

Hi Robert

Thanks for your idea! As we have built up our solutiion to a certain model I do not want to change, so your proposal is in this case not really an option.

Still thanks for always fresh ideas form you, very appreciated ![:-)]( "Smile")

Regards, Robert

> ROCLASI:  
> Hi Robert,
> 
> I tend to use a seperate form for searches and use radiobuttons for this with 2 options (checked/notchecked).
> 
> Hope this helps.

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [July 17, 2008, 8:15am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/4 "2008-07-17T08:15:59Z")

</div>

Hi Robert,

Is it the issue with using a separate form ?

If so, why not use the same form and replace the checkbox with radios using ‘visible’ property or similar - so you have the two items on the same form but alternate which one you see using a method triggered when going into find mode ?

Cheers  
Harry

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 17, 2008, 8:32am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/5 "2008-07-17T08:32:19Z")

</div>

Hi Harry

It’s the issue that I don’t think I have to adapt a logical solution to the tool. I think it may not be that way so I refuse it, so to say on the methodology side of the discussion.  
But what I sure refuse is to use radio buttons instead of checkboxes, just to overcome a weakness. A radio button is a selection of 1 out of n, whereas the checkbox is n out of m. So I do not want to break this logic, as I think there are already enough not so good user interfaces out there and we are at least trying to make a good one .-)

But the real point seems no one to say explicitly, it is NOT possible to find an unset checkbox, or is it?

Regards, Robert

> Harry Catharell:  
> Hi Robert,
> 
> Is it the issue with using a separate form ?
> 
> If so, why not use the same form and replace the checkbox with radios using ‘visible’ property or similar - so you have the two items on the same form but alternate which one you see using a method triggered when going into find mode ?
> 
> Cheers  
> Harry

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [July 17, 2008, 8:46am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/6 "2008-07-17T08:46:07Z")

</div>

Hi Robert,

I understand your point now.

It is a GUI issue with how that search can be presented to the user.

A single checkbox represents both an ‘on’ and an ‘off’ state together and you cannot find an ‘off’ state in a vanilla search form.

As the difference here is the logical operator of ‘NOT’ why not add this option to the find form so that the user can choose the checkbox and then choose to add the ‘NOT’ operator which then can control a search which excludes that value from the results  
So the search actually becomes either:  
Find ‘x’  
OR  
Find NOT ‘x’

I can’t imagine how you will present this to the user - just trying to brainstorm some possible solutions ![:)]( "Smile")

Cheers  
Harry

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [July 17, 2008, 9:10am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/7 "2008-07-17T09:10:03Z")

</div>

The thing is with a checkbox that when you do a find you actually want to use 3 states:

- checked
- unchecked
- don’t use in search at all

Servoy will only handle the first and last option.  
Not sure how Servoy should handle it differently though. How would you represent a NOT (checked) in a checkbox ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 17, 2008, 9:12am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/8 "2008-07-17T09:12:22Z")

</div>

Hi Harry

Your are right at the point! I am wondering how to present in Find mode the possibility to search for checkbox on or off. Someone sure must have come accross this but I can’t find some well thought out method or hint.  
Servoy (by accident I assume, as it only works half way) allows to search for the ‘on’ state of a checkbox, but I can’t find out how to search for the ‘off’ state.  
An elegant solution (my opinion only) would be if there is a visual feedback in Find mode when I set a checkbox to unset (‘off’ state) - even if the user would have to click twice to ‘set’ the ‘off’ state in Find mode. What do you think?

Regards, Robert

> Harry Catharell:  
> Hi Robert,
> 
> I can’t imagine how you will present this to the user - just trying to brainstorm some possible solutions ![:)]( "Smile")
> 
> Cheers  
> Harry

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 17, 2008, 9:14am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/9 "2008-07-17T09:14:17Z")

</div>

Hi Robert

Thanks, how do we get the

- don’t use in search at all?

See my just posted answer to Harry for the unchecked state.

Regards, Robert

> ROCLASI:  
> The thing is with a checkbox that when you do a find you actually want to use 3 states:
> 
> - checked
> - unchecked
> - don’t use in search at all
> 
> Servoy will only handle the first and last option.  
> Not sure how Servoy should handle it differently though. How would you represent a NOT (checked) in a checkbox ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [July 17, 2008, 9:17am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/10 "2008-07-17T09:17:26Z")

</div>

> ROCLASI:  
> By not touching the checkbox at all after you go into find mode.  
> Not sure if it is used in the search when you check and uncheck it again though. Would have to test that.

Tested it in 3.5.6.  
When you check and uncheck it then that field is (still) not used in the search.

ACK! ![:oops:]( "Embarassed") Edited my original post instead of quoting it!

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [July 17, 2008, 9:36am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/11 "2008-07-17T09:36:27Z")

</div>

Hi Robert - both of you ![:)]( "Smile")

I like the idea of the checkbox representing the 3 states in find mode (check, uncheck, not used)

In order to do this could you present the checkbox as a series of 3 icons which you toggle between as you click on it ?

Click once and a check or tick icon shows that the value is to be searched for  
Click again and a hyphen or minus symbol shows that the value must be empty  
Click again and the icon shows blank checkbox which means that it is not used in the search

Each click will cycle you through those three choices and your method handles the search criteria based on the choice

Cheers  
Harry

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 17, 2008, 9:40am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/12 "2008-07-17T09:40:59Z")

</div>

Hi Harry

I fully support this idea! This would really be great to have (at least for apps having checkboxes). I completely forgot the idea of the minus, used for example in the DTP tool FrameMaker.  
The display of the minus if the checkbox value is null would be very nice in ‘normal’ view as well.  
Would you propose your ideas in the support system, please?

Many thanks, Robert

> Harry Catharell:  
> Hi Robert - both of you ![:)]( "Smile")
> 
> I like the idea of the checkbox representing the 3 states in find mode (check, uncheck, not used)
> 
> In order to do this could you present the checkbox as a series of 3 icons which you toggle between as you click on it ?
> 
> Click once and a check or tick icon shows that the value is to be searched for  
> Click again and a hyphen or minus symbol shows that the value must be empty  
> Click again and the icon shows blank checkbox which means that it is not used in the search
> 
> Each click will cycle you through those three choices and your method handles the search criteria based on the choice
> 
> Cheers  
> Harry

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [July 17, 2008, 9:48am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/13 "2008-07-17T09:48:26Z")

</div>

Hi Harry and Robert,

I know on Mac the minus in the checkbox is not a strange thing. The question is do the other LAF’s support it. I can’t remember seeing it used on any other platform than Mac.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [July 17, 2008, 11:34am UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/14 "2008-07-17T11:34:10Z")

</div>

to really be able to do this in the ui we need a tripple state checkbox (most of the time in the ui you see 'grayed out square in it like: [http://www.databasedev.co.uk/triplestate\_checkbox.html](http://www.databasedev.co.uk/triplestate_checkbox.html)

But cant you override the onSearch command? and then when a search happens just look if the value is set in the find state and if it isnt set it in code yourself and then do the search?

one problem, when i tested this myself i did encounter a bug in 4.0 that you cant test for unset values in a findstate, i will fix this  
(doing things like:

if (!myboolean)  
{  
myboolean = 0;  
}

in an onSearch method.

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 17, 2008, 2:04pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/15 "2008-07-17T14:04:44Z")

</div>

Hi Johann

> jcompagner:  
> to really be able to do this in the ui we need a tripple state checkbox (most of the time in the ui you see 'grayed out square in it like: [http://www.databasedev.co.uk/triplestate\_checkbox.html](http://www.databasedev.co.uk/triplestate_checkbox.html)

Only if you are a Windows guy. But as Jan showed in his .NET vs Servoy comparison in Muenchen, 67% of Windows guys are looking for a way to leave Windows, so you won’t see it so often any more .-)  
Seriously, this should be OS specific, of course, and on a Mac for example you never see grayed out squares…

> jcompagner:  
> But cant you override the onSearch command? and then when a search happens just look if the value is set in the find state and if it isnt set it in code yourself and then do the search?
> 
> one problem, when i tested this myself i did encounter a bug in 4.0 that you cant test for unset values in a findstate, i will fix this  
> (doing things like:
> 
> if (!myboolean)  
> {  
> myboolean = 0;  
> }
> 
> in an onSearch method.

Good idea, but the user needs visual feedback.

Regards, Robert

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [July 17, 2008, 2:13pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/16 "2008-07-17T14:13:38Z")

</div>

Are there tri state checkboxes on the mac?  
How do they look?

for example here is one that did try to make one by also trying to preserve the LnF

[http://www.roseindia.net/javatutorials/ … kbox.shtml](http://www.roseindia.net/javatutorials/tristatecheckbox.shtml)

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [July 17, 2008, 2:33pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/17 "2008-07-17T14:33:51Z")

</div>

but if you want to see it you need a tristate checkbox  
Does the mac has such a thing? Do you know how it looks like?

there is a guy here:  
[http://www.roseindia.net/javatutorials/ … kbox.shtml](http://www.roseindia.net/javatutorials/tristatecheckbox.shtml)

that tried to make one by trying to get the lnf as good as he could get.

---

<div class="post-metadata">

**Author:** ![Harry\_Catharell](https://avatars.discourse-cdn.com/v4/letter/h/e19adc/32.png) [@Harry\_Catharell](https://forum.servoy.com/u/Harry_Catharell)\
**Post date:** [July 17, 2008, 4:18pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/18 "2008-07-17T16:18:59Z")

</div>

If you want to, why not set this up using a single dataprovider with three different images that change programmatically with every click and then branch inside the onSearch override method ?

Cheers  
Harry

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 17, 2008, 4:43pm UTC](https://forum.servoy.com/t/find-mode-how-to-find-unchecked-checkboxes/9302/19 "2008-07-17T16:43:36Z")

</div>

Hi Johann

I know it the way Robert Ivens said, so it looks like in the picture below. I did not find a hint or example in the OSXHIGuidelines though.

Regards, Robert

> jcompagner:  
> but if you want to see it you need a tristate checkbox  
> Does the mac has such a thing? Do you know how it looks like?
> 
> there is a guy here:  
> [http://www.roseindia.net/javatutorials/ … kbox.shtml](http://www.roseindia.net/javatutorials/tristatecheckbox.shtml)
> 
> that tried to make one by trying to get the lnf as good as he could get.

 ![tristate checkbox.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/8/809176428142c58a0ca6d660c8bf5a35b74f442f.png)
