[tw5] List filter using the checkbox widget

I am able to use the radio widget to control my list filter. Now I would like to use checkboxes in a multi-select manner (e.g., include any checked keywords: Info, fix, Procedure). However, I haven’t seen an example of this yet. My attempt

''KBA Type:''  <$checkbox tiddler="$:/temp/ktype" value="Procedure"> Procedure  <$checkbox tiddler="$:/temp/ktype" value="Info"> Info  <$checkbox tiddler="$:/temp/ktype" value="Fix"> Fix 


<$list filter="[tag[KBA]ktype{$:/temp/ktype}]">

I think I expected all selected items to be handled in the same temp tiddler but maybe I’m overwriting it each time I check/uncheck. Do I need to create a temp tiddler for each and work out the list filter logic manually in a sequence of separate runs?

Not sure it’s relevant, but I will be wanting to use this to filter on values in a field. That field may contain a single string or list of strings (examples: Info or Fix Procedure or Fix Info). Ultimately I would like to derive the list of checkboxes from a field within all tiddlers with a specific tag. Like a “tag” based search engine except they are not TW tags, they are just tags derived from the tiddler field. But, baby steps (assuming it’s possible/practical).

1 Like

jkm

Have you looked at the select widget, it also has a multiple option.

Tones

I might be proven wrong, but my experience is that it’s a 1:1 relationship between the checkbox and a storage location, there’s not a way to directly have multiple checkboxes change a list per-se. A couple of ideas though:

  • You could use the same temp tiddler and use individual fields for your possible values, that might make it easier to collect the values for later processing.
  • There are now “checkactions” and “uncheck actions” associated with the widget. So, if you wanted to, you could force the checkboxes to run a listops routine to add-subtract values from a list. This would be the closest to what your expecations are, but it might not actually be the most efficient.

@Tones
I did see the select widget but was hoping for a method that takes up less space and has a slightly easier mechanic. I’ll may use it, at least for now

@Stobot
I hadn’t thought of using fields in the temp tiddler. I think I would need a method of naming and incrementing through the fields as this will change based on the source tiddler’s field contents

Thanks to you both for a quick reply

Also remember you can make yourself a set of buttons and they can do what you want, then double them and conditionally show the appropriate one for the current state.

Buttons can replicate checkboxes, radio buttons and much more if you want, in fact tabs we use are and can be designed as buttons.

Tones

G’day,

Yeah, you’re right: each checkbox is indeed overwriting the (entire) field with what is associated with the one selected checkbox.

i.e. the field doesn’t aggregate the values of multiple selected check boxes.

I imagine you’ve noticed that having each check box associated with the same field, the checkboxes behave like radio buttons.

Hi,

I didn’t test it, but the checkbox [1] widget has “check” and “uncheck” actions. You may use the listops [2] operators there.

[1] https://tiddlywiki.com/prerelease/#CheckboxWidget

[2] https://tiddlywiki.com/prerelease/#Filter%20Operators

-mario

Hello,

This should help : https://groups.google.com/g/tiddlywiki/c/5e3ta-q-qIA/m/uIKL1C9PAgAJ