mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-09 03:19:56 +00:00
41 lines
1.7 KiB
Plaintext
41 lines
1.7 KiB
Plaintext
caption: action-sendmessage
|
|
created: 20141008134309742
|
|
modified: 20141008162952455
|
|
tags: Widgets ActionWidgets
|
|
title: ActionSendMessageWidget
|
|
type: text/vnd.tiddlywiki
|
|
|
|
! Introduction
|
|
|
|
The ''action-sendmessage'' widget is an [[action widget|ActionWidgets]] that sends a [[message|WidgetMessages]] back up the widget tree. ActionWidgets are used within triggering widgets such as the ButtonWidget.
|
|
|
|
! Content and Attributes
|
|
|
|
The ''action-sendmessage'' widget is invisible. Any content within it is ignored.
|
|
|
|
|!Attribute |!Description |
|
|
|$message |The message to send (eg, [[WidgetMessage: tm-new-tiddler]]) |
|
|
|$param |Optional parameter string whose meaning is dependent on the message being sent |
|
|
|//{any attributes not starting with $}// |Multiple parameters that are attached to the message if the `$param` attribute is not provided |
|
|
|
|
! Examples
|
|
|
|
Here is an example of button that displays both a notification and a wizard, and creates a new tiddler with tags and text:
|
|
|
|
<$macrocall $name='wikitext-example-without-html'
|
|
src='<$button>
|
|
<$action-sendmessage $message="tm-modal" $param="SampleWizard"/>
|
|
<$action-sendmessage $message="tm-notify" $param="SampleNotification"/>
|
|
<$action-sendmessage $message="tm-new-tiddler" title="This is newly created tiddler" tags="OneTag [[Another Tag]]" text=<<now "Today is DDth, MMM YYYY">>/>
|
|
Click me!
|
|
</$button>'/>
|
|
|
|
Here is an example of a button that assigns tags and fields to the tiddler HelloThere, and then initiates editing it:
|
|
|
|
<$macrocall $name='wikitext-example-without-html'
|
|
src='<$button>
|
|
<$action-setfield $tiddler="HelloThere" tags="MoreTag [[Further More Tags]]" color="green"/>
|
|
<$action-sendmessage $message="tm-edit-tiddler" $param="HelloThere"/>
|
|
Edit ~HelloThere
|
|
</$button>'/>
|