Action
Description
An Action is a way to influence the behaviour or appearance of a widget. An Action can only exist inside an ActionList.
Attributes
- Attribute [string]: The name of the attribute of the Subject that will be modified.
- AttributeValue [depends on Attribute]: The new value of the specified Attribute of the specified Subject.
- Name [string]: The name of the block.
- SourceAttribute [string]: The name of the attribute of the SourceObject to use as value to set the Attribute of the Subject to.
- SourceObject [name of block]: When specified, the specified Attribute will be set to the value of the SourceAttribute of the SourceObject.
- Subject [string]: The name of the block that will be modified.
- Trigger [boolean]: Whether or not the action should cause a trigger when executed. Default: false
Remarks
- When a SourceObject is specified, SourceAttribute must also be present and AttributeValue may not be present.
- When a Subject is present, Attribute must also be present. Either AttributeValue or (exclusive) the SourceObject/SourceAttribute must be present.
- When present, the SourceAttribute must be of the same type as Attribute.
Examples
1 <VisualPage>
2 <VisualContent>
3 <VisualText Name="loadingtext" Text="loading..."/>
4 <VisualImage Url="http://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Belgium_cofa.PNG/85px-Belgium_cofa.PNG"
5 ImageLoaded="onimageloaded"/>
6 </VisualContent>
7 </VisualPage>
8
9 <ActionList Name="onimageloaded">
10 <Action Subject="loadingtext" Attribute="Visible" AttributeValue="false"/>
11 </ActionList>
12
13 <!-- This example will show a "loading..." text that will disappear (by setting the Visible attribute to "false") when the image has finished loading. -->
1 <!-- The following example demonstrates assigning the value of one attribute to another: -->
2 <VisualPage>
3 <VisualContent>
4 <VisualText Name="loadingtext" Text="loading..."/>
5 <VisualImage
6 Name="image"
7 Url="http://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Belgium_cofa.PNG/85px-Belgium_cofa.PNG"
8 ImageLoaded="onimageloaded"/>
9 </VisualContent>
10 </VisualPage>
11
12 <ActionList Name="onimageloaded">
13 <Action Subject="loadingtext" Attribute="Text"
14 SourceObject="image" SourceAttribute="Url"/>
15 </ActionList>
16
17 <!-- After loading the image, the "loading..." text will change into the url of the image. -->
See also
User comments
Leave a comment
You need to be logged in to post a comment.

May 16th, 2008 at 9:39 p.m.