|
|
|
|
|
Use the Action tab to define the actions that your part uses to perform specific tasks. Actions are operations and services, such as closing or opening a window. Generally, actions are performed when an event occurs in your application.
The Action tab lists all actions defined by a part. This tab does not list actions that are inherited from the base part. This tab also does not list promoted actions that are defined by embedded parts. Promoted actions are listed on the Promote tab.
an Action calls the action member function you specify to perform a task. If you specify the action return type, the actionResult event is available to report the return value.
To use an action, make a connection to its name. When you generate code, the action member function is used to perform the task. If you connect an event to an action, the event signals the action to run. For example, if you connect the buttonClickEvent of a push button in an order entry window to an action that adds an order for a customer, that action is performed when the user selects the button.
Use the following fields to specify an action:
Connections
Adding Action Features
Push Buttons -- Part Interface
Editor
Part Interface Editor
Visual Composition Messages
Use the Action name field to specify a descriptive name for an action. This name appears on the connection menu when you make connections to the action in the Composition Editor.
The action name can contain only single-byte alphanumeric characters and blanks. Each action name within a part must be unique.
You cannot change the action name directly. To rename an action, do the following:
Use the Action member function field to specify the name of the member function that is called to perform the action. This can be the same as the action name.
If you select the Defaults push button, a default member function signature is placed in the Action member function field. The action member function name is derived from the action name.
VisualAge generates default code for the action member function if you select File, then Save and generate, then Feature source. You can then edit the skeleton provided in the default code to provide the code that the action member function is to perform.
Use the Return type field to specify the data type of the value that the action returns. Selecting either the Add with defaults or Defaults push button causes a default return type of int to be inserted into this field.
Leaving this field blank is the same as entering a return type of void. In either case, the actionResult feature is not available. If you specify the action return type, the actionResult event is available to report the return value.
