On Friday, April 17, 2020 at 5:32:44 AM UTC-7, si wrote:
>
> I'm specifically trying to set a timestamp every time I use the radio
> widget to change the value of a field.
> The only thing I can think of currently is to create my own radio widget
> functionality with buttons and the reveal widget. Maybe there is an easier
> solution?
>
You do need to use the $button widget, but don't need to use the $reveal
widget.
Here's a working example (tested on TiddlyWiki.com)
\define choice_actions(value)
<$action-setfield choice="$value$" />
<$action-setfield timestamp=<<now YYYY0MM0DD0hh0mm0ss0XXX>> />
\end
<$button class="tc-btn-invisible" actions=<<choice_actions>>>
<$radio field="choice" value="one"> one </$radio>
</$button>
<$button class="tc-btn-invisible" actions=<<choice_actions>>>
<$radio field="choice" value="two"> two</$radio>
</$button>
<$button class="tc-btn-invisible" actions=<<choice_actions>>>
<$radio field="choice" value="three"> three </$radio>
</$button>
choice = {{!!choice}}, timestamp = {{!!timestamp}}
The $radio widget *displays* the current choice, but the choice value (and
the timestamp) are *set* by the surrounding $button widget.
Let me know how it goes.
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/2cda94fa-eaf0-4013-af30-affa218d5489%40googlegroups.com.