[Prev] [Next] [Top] [Bottom] [Contents] (8 out of 16)

Object Bind Editor

The Object Bind Editor is the place that Object Bindings are created. In order for the Object Bind Editor to be invoked, a valid Activator must be first selected (Using the Activator Selector). When a Data Object is opened, all of its Arguments and Results are displayed. The developer can then bind the Arguments to HTML Form Input Elements and the Results to Data Sites contained in a Template.

States of the Object Bind Editor

Figure 2-26 Object Bind Editor

About the Object Bind Editor

Pulldown Menus

File

Edit

Tools

Help

How to Invoke the Interface

1. The Tools Menu of the Project Window
2. The Project Window's Selected Activators Pop-up
3. The Project Window's Main Button Bar
4. Double-clicking the Project Window's Activators Area list.
5. The project Window's Selected Activator's Button Bar
6. The Activator Code interface's Bind button

Arguments

Arguments are input to a Data Object. Some Data Objects have Arguments and some don't.

Valid Values for Arguments

Any valid C expression that returns a character pointer (char *) is a valid Argument value. Example:

1. Hard-coded string:
	"Scott"
2. Constant:
	#define ARGVAL "Scott"
3. An initialized variable:
	char *argval = strdup("Scott");
4. A function that returns a character pointer:
	char *SaGetInputValue(char *name);
Functions should never return malloc'd data because it can never be free'd.

Form Arguments

When a Form Activator with form input elements is bound to a Data Object that has Arguments, the names of the input elements are displayed in the Argument Value combo. When an element name is selected from the combo, it is wrapped as follows:

SaGetInputValue("element_name")
The function call SaGetInputValue will return the values that the end user set the element_name element to. This data does not have to be free'd. If the Sapphire/Web developer wishes to use a function, it should not malloc data because it can never be free'd.

Anchor Arguments

When an Anchor Activator is bound to a Data Object that has Arguments, there are no names to bind to. Therefore, it is necessary to retrieve Anchor Arguments by number. In the Argument Value combo, there is a function for this purpose:

SaGetNArg(0)
SaGetNArg will by default, get the first Anchor Argument's value. To retrieve the remaining values, change 0 to the number of the Argument you wish to retrieve a value for.

Results

Results are returned from the execution of a Data Object. Not all Data Objects have results. Valid values for Result Column Values are Data Sites contained within the selected Template. When selected, the Data Site's name is copied to the Result Column Value textField.

Multiple Result Columns can be bound to the same Data Site. This will cause the returned data to be populated into that single Data Site. The behavior of the population of Data Sites depends upon the Population Callback specified. The default Population Callback is SaPopulateForText.

Results Detail Dialog

The Results Detail Dialog enables the developer to specify detail information about the binding of a Results Column to a Data Site. The detailed information includes the Population Callback, Client Data, result column order and Population Callback Options.

Figure 2-27 Results Detail Dialog

Population Callback Options

When a Population Callback is written to handle Options, they are specified within an Options Editor. The following describes the version of the Options Editor used for this purpose. See the Options Editor section for more information on the Options Editor.

Figure 2-28 Population Options Dialog


[Prev] [Next] [Top] [Bottom] [Contents] (8 out of 16)