List filter using the checkbox widget

65 views
Skip to first unread message

John Mayes

unread,
Aug 26, 2021, 7:26:28 AM8/26/21
to TiddlyWiki
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

...
    <td>''KBA Type:''&ensp;
      <$checkbox tiddler="$:/temp/ktype" value="Procedure">&nbsp;Procedure</$checkbox>&ensp;
      <$checkbox tiddler="$:/temp/ktype" value="Info">&nbsp;Info</$checkbox>&ensp;
      <$checkbox tiddler="$:/temp/ktype" value="Fix">&nbsp;Fix</$checkbox>&ensp;  
    </td>
...
<$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).

TW Tones

unread,
Aug 26, 2021, 8:07:40 AM8/26/21
to TiddlyWiki
jkm

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

Tones

Stobot

unread,
Aug 26, 2021, 8:19:10 AM8/26/21
to TiddlyWiki
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. 

John Mayes

unread,
Aug 26, 2021, 8:51:56 AM8/26/21
to TiddlyWiki
@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

TW Tones

unread,
Aug 26, 2021, 10:28:37 AM8/26/21
to TiddlyWiki
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

Charlie Veniot

unread,
Aug 26, 2021, 11:41:36 AM8/26/21
to TiddlyWiki
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.

PMario

unread,
Aug 26, 2021, 2:24:50 PM8/26/21
to TiddlyWiki
Hi,
I didn't test it, but the checkbox [1] widget has "check" and "uncheck" actions. You may use the listops [2] operators there.


-mario

Télumire

unread,
Aug 27, 2021, 12:41:24 AM8/27/21
to TiddlyWiki
Reply all
Reply to author
Forward
0 new messages