Maplets[Elements]
Action
define an action
Calling Sequence
Parameters
Description
Examples
Action(opts, element_content)
Action[refID](opts, element_content)
opts
-
equation(s) of the form reference=value; specify options for the Action element
element_content
any number of Action or command elements
refID
name or string; reference to the element
The Action element defines an action in a Maplet application.
The Action element features can be modified by using options. To simplify specifying options in the Maplets package, certain options and contents can be set without using an equation. The following table lists elements, symbols, and types (in the left column) and the corresponding option or content (in the right column) to which inputs of this type are, by default, assigned.
Elements, Symbols, or Types
Assumed Option or Content
reference option
An Action element can contain any number of other Action elements or command elements such as CloseWindow, Evaluate, SetOption, RunWindow, RunDialog, and Shutdown.
An Action element can be contained in a Maplet element; in an equation for the onapprove, oncancel, onchange, onclick, ondecline, or onstartup option for an element; or as a parameter in an element that accepts an onchange or onclick option without an equation.
The contents of an Action element are evaluated in order. Each action is completed before the next is started. The contents of any nested Action elements are evaluated in order.
The following table describes the control and use of the Action element options.
An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition).
An x in the R column indicates that the option is required in the calling sequence.
An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool.
An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool.
Option
I
R
G
S
reference
x
run
The opts argument can contain one or more of the following equations that set Maplet application options.
reference = name or string
A reference for the Action element.
If the reference is specified by both an index, for example, Action[refID], and a reference in the calling sequence, the index reference takes precedence.
run = true
This is a settable field that indicates that the specified action be run as soon as control returns to the Maplet application. This is useful for specifying the conditional shutdown of a window.
A Maplet application that has actions associated with buttons:
with⁡MapletsElements:
maplet1≔Maplet⁡TextFieldTF1⁡,ButtonB1⁡Clear,onclick=A1,ButtonB2⁡OK,onclick=A2,ActionA1⁡SetOption⁡target=TF1,ActionA2⁡Shutdown⁡TF1:
MapletsDisplay⁡maplet1
Note that this Maplet application can more easily be written as:
maplet2≔Maplet⁡TextFieldTF1⁡,ButtonB1⁡Clear,SetOption⁡target=TF1,ButtonB2⁡OK,Shutdown⁡TF1:
MapletsDisplay⁡maplet2
See Also
Maplets/CommandElements
Maplets[Display]
Maplets[Elements][Button]
Maplets[Elements][Maplet]
Maplets[Elements][SetOption]
Maplets[Elements][Shutdown]
Maplets[Elements][TextField]
Maplets[Tools][Get]
Maplets[Tools][Set]
Overview of Maplet Applications
Download Help Document