This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

ActionConfirmWidget

15 novembre 2020 à 16h03

Introduction

Depuis : 5.1.23The action-confirm widget is an action widget that prompts the user for confirmation and invokes other action widgets contained within it only if the user confirms. ActionWidgets are used within triggering widgets such as the ButtonWidget.

Content and Attributes

The action-confirm widget is invisible. Any content within it is only processed if the user confirms the action, or the confirmation has been disabled by the $prompt attribute.

AttributeDescription
$messageOptional message displayed to the user when asking for confirmation.
$promptOptional flag, set to "no" to disable the prompt for confirmation. Defaults to "yes"

Examples

Here is an example of a button that asks the user for confirmation, before deleting the caption and tags fields of the current tiddler:

<$button>
<$action-confirm $message="Do you wish to delete the caption and tags?">
<$action-deletefield caption tags/>
Delete "caption" and "tags"
</$action-confirm>
</$button>

Affichera ceci :

Here is an example of a button that uses the optional $prompt attribute to control whether to prompt the user before deleting the text field of the tiddler HelloThere:

<$button>
<$action-confirm $message="Do you wish to delete the text field?" $prompt={{$:/state/promptUser}}>
<$action-deletefield $tiddler="HelloThere" $field="text"/>
</$action-confirm>
Delete text from ~HelloThere
</$button>

Affichera ceci :