Publish events
In the following sections, we'll take a look at several events that you can publish. This should give you a good idea about how the Publish
element works.
DoAction
The DoAction event calls a custom action that you've declared elsewhere in your markup. For example, suppose we'd defined a custom action called CA_ShowMessage
that simply displays a message box with the text You clicked?:
<CustomAction Id="CA_ShowMessage" Script="vbscript" Execute="immediate"> <![CDATA[msgbox "You clicked?"]]> </CustomAction>
We could then trigger this action with a PushButton
by publishing the DoAction
event with a value of CA_ShowMessage
.
<Control Id="DoActionButton" Type="PushButton" X="120" Y="100" Width="56" Height="17" Text="Click Me!"> <Publish Event="DoAction" Value="CA_ShowMessage" /> </Control>
Clicking on the button will show the following message:
Often...