A question regarding radio buttons

143 views
Skip to first unread message

The Scribe

unread,
Mar 11, 2021, 6:31:15 PM3/11/21
to tiddl...@googlegroups.com
I have been following the instructions giving in Soren’s video to set up a reading list (although mine is a different type of list). I’ve set up radio buttons, in the video they were for “read” and “unread”, which I’ve adapted for my own use. However, I’d like to add a third option to show all, ie show the entire list. How can I do this please?

Best wishes,
Karen

Sent from my iPad

TheScribe

unread,
Mar 12, 2021, 4:51:22 AM3/12/21
to TiddlyWiki

I should have given the code I've used for the radio buttons.  What I'm trying to achieve is radio buttons with these options:  Show All, New, Completed

The coding for New and Completed is below. These work fine. 

<$radio tiddler="$:/temp/ExampleCodingMode" value="Completed">&nbsp;Completed</$radio>&ensp;
<$radio tiddler="$:/temp/ExampleCodingMode" value="New">&nbsp;New</$radio>

However, I don't know how to code the Show All button. This option opens both the New and Completed options so that I can view everything. I've tried a few things, but my knowledge is limited and nothing is working. 

Can anyone help me with this, please?

kind regards,
Karen

PMario

unread,
Mar 12, 2021, 6:24:06 AM3/12/21
to TiddlyWiki
On Friday, March 12, 2021 at 10:51:22 AM UTC+1 TheScribe wrote:

The coding for New and Completed is below. These work fine. 

<$radio tiddler="$:/temp/ExampleCodingMode" value="Completed">&nbsp;Completed</$radio>&ensp;
<$radio tiddler="$:/temp/ExampleCodingMode" value="New">&nbsp;New</$radio>

However, I don't know how to code the Show All button. This option opens both the New and Completed options so that I can view everything. I've tried a few things, but my knowledge is limited and nothing is working. 

You should show us the filter, that produces your list.

Adding a new option is simple.

<$radio tiddler="$:/temp/ExampleCodingMode" value="Completed">&nbsp;Completed</$radio>&ensp;
<$radio tiddler="$:/temp/ExampleCodingMode" value="New">&nbsp;New</$radio>
<$radio tiddler="$:/temp/ExampleCodingMode" value="All">&nbsp;Show all</$radio>

or as shown in the docs.

<$tiddler tiddler=" $:/temp/ExampleCodingMode ">
  <$radio value="Completed">&nbsp;Completed</$radio>&ensp;
  <$radio value="New">&nbsp;New</$radio>
  <$radio value="All">&nbsp;Show all</$radio>
</$tiddler>

The second example makes it easy to change the tiddler title and only edit it once.

-mario


PMario

unread,
Mar 12, 2021, 6:25:13 AM3/12/21
to TiddlyWiki
On Friday, March 12, 2021 at 12:24:06 PM UTC+1 PMario wrote:

<$tiddler tiddler="$:/temp/ExampleCodingMode">
  <$radio value="Completed">&nbsp;Completed</$radio>&ensp;
  <$radio value="New">&nbsp;New</$radio>
  <$radio value="All">&nbsp;Show all</$radio>
</$tiddler>


There shouldn't be any spaces in the tiddler title.
-m

Soren Bjornstad

unread,
Mar 12, 2021, 9:14:47 AM3/12/21
to TiddlyWiki
Mario covered how to add the radio button, for the filter I would use regexp (regular expression search). So instead of directly checking status with status{$:/temp/ExampleCodingMode}, you'd say:

regexp:status{$:/temp/ExampleCodingMode}

In a regular expression you can then say .* to match anything, as well as just plain Completed, so your new radio button would use .* as the value. As long as you're just using letters and numbers as the values, you don't have to do anything special with the other values, but it's possible to get almost arbitrarily complex with JavaScript regular expressions if you want to include other combinations.

The Scribe

unread,
Mar 12, 2021, 4:16:57 PM3/12/21
to tiddl...@googlegroups.com
Thank you for the responses. I used Soren’s suggestion and it worked perfectly. I’ve managed to sort out all my other issues and am ready to start adding real data to my list. Woohoo. 

Again thanks,
Karen

Sent from my iPad

On 13 Mar 2021, at 1:14 am, Soren Bjornstad <soren.b...@gmail.com> wrote:


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/O1oylX4H97k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/889c5c7a-4164-4dc8-afc7-484e5460f364n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages