Answering my own questions ... it turns out this version works:
<$fieldmangler>
<$set filter="[[Example]] [[Example 2]] +[tags[]]" name="tag">
<<tag>>
<$checkbox actions="""<$action-setfield $field="tags" $value=<<tag>>
/><$action-sendmessage $message="tm-add-tag" $param=<<tag>> />"""
field="checked" checked="YES" unchecked="NO" >
Add tags from [[Example]] and [[Example 2]]
</$checkbox>
</$set>
</$fieldmangler>
I'm using action-setfield and action-sendmessage to demonstrate two
actions. The action-sendmessage joines all the tags into one large tag.
The action-setfield appends the tags as individual tags. Note the
correction to the action-sendmessage ('param' vs. '$param') The
<$fieldmangler> is required for action-sendmessage but not for
action-setfield. The action occurs whether you check or uncheck, so that's
something to watch out for. Surrounding the actions string with triple
quotes seemed to be necessary.
I still think Matt's way is more intuitive, but if that isn't available ...
HTH
Mark
On Wednesday, December 21, 2016 at 10:44:16 AM UTC-8, Mark S. wrote:
>
> Your method makes more sense to me. I'm guessing that there were technical
> reasons for making it different from the button.
>
> At the very least, there should be an example for how to use the new super
> powers. In particular, I'm wondering how and if you can pass off a variable
> to the parameters? Do you need complete <$action...></$action> syntax? Does
> it need to work with the <$fieldmangler> or can it be used independently?
> Inquiring minds want to know.
>
> Good luck!
> Mark
>
>
>
> On Wednesday, December 21, 2016 at 8:47:31 AM UTC-8, Matthew Lauber wrote:
>>
>> All,
>> I was looking at the release notes for the 5.1.14 prerelease, and it
>> mentioned the actions param of the checkbox widget. Excited, I checked it
>> out, only to be confused. From the description of the param "A string
>> containing ActionWidgets to be triggered when the checkbox is clicked"
>> it sounds like it triggers actions set as a param, rather than actions that
>> are children of the checkbox widget. This is the opposite of how buttons
>> work, and makes it difficult to have multiple action widgets, and
>> impossible to generate actions widgets from a a <$list> widget. As an
>> example, I'd like to be able to do this.
>>
>> <$checkbox actions="true">
>> Add tags from [[Example]] and [[Example 2]]
>> <$list filter="[[Example]] [[Example 2]] +[tags[]]" variable="tag">
>> <$action-sendmessage $message="tm-add-tag" param=<<tag>> />
>> </$list>
>> </$checkbox>
>>
>> Is there a reason why the actions param is the actual list of actions?
>> Would a PR for my suggestion be welcome?
>>
>> Matt Lauber
>>
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/efda939e-029f-470d-b5c4-6a9d6da30abe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.