Bungee Logic : Schema : Field
Contents |
Description
Declares a new member field in the specified class. A field (also called a data member) is an encapsulation of data within a class or object. When you add fields to a class, they are displayed in the Solution Detail (fields and classes are part of the Model code).
Syntax
access type name [= value]; {OnInit{} OnChange{}}
Where:
access
is one of: public, protected, private, or internal.
Public makes the class visible from all classes, protected and, private are unused, and internal makes the class visible only to the containing project.
Note Currently, only internal access modifers are accepted for fields.
type Is the type you declare the field to be; for example, a string or an int. name Must be a name unique within the class. The typical naming convention in Bungee is to use camel case, for example: firstName. value The optional initialization value.
Logic
The simplest form of a field declaration appears like this.
Use the Default Value property to set an initial value to the field.
You can use the [+] icon to see the intrinsic functions and add code to them if desired.
[-] public string firstResponse='No Response';
{
[-] OnInit
{
// Your code here
}
[-] OnChange
{
var Data oldValue;
// Your code here
}
}
Error Handling
-None-
Intrinsics
Functions
- OnInit — Executed when the field is first created at runtime. Similiar to a C++ constructor.
- OnChange —Executed when the value of the field changes at runtime.
Variables
- oldValue — Used to store the previous value of a field.
Properties
General Tab
- Access Modifier — Specifies the field's visibility.
- Adapter List — Specify a list of form and/or function adapters.
- Default Value — A site that determines the value that the field is initialized with. For priimitive types like string, boolean, and int, the site should usually be a Data. For objects, the site should usually be an Object so that an actual runtime object gets created for the field (unless the field is meant to be a reference to another object).
- Enumeration — For setting value/display pairs for when the field is bound to something like a combo box.
- Is Collection — If selected, creates a the field as a collection of the type you declared the field to be.
- Is Map — Toggles the class member field as a Map containing key-value pairs.
- Is Persistent — Saves the field value in an associated Datasource.
- Name — The name of the field. This must be unique to the class.
- Nullable — Set the field to null when the class is constructed, or to allow a null argument to be passed to a function.
- Type — The type of the field. To change the type of the field from the default of string, select the field statement, and select the ellipsis button for the Type property on the Property Editor. The type selection dialog will appear that will allow you to select from the available types for the current project. To access the default types available in the Runtime, select the project->Dependencies->Runtime->Types project in the type selection tree.
Behavior Tab
- Always Sent — Send the field data to the sever even when the field value is null.
- Copy Type — Specify ownership and how copy operations will apply to this field.
- Defer List —
- Is Encrypted —
- Manage Reference Count — Turn on/off automatic reference counting (and garbage collection).
- Needs Encoding — Indicates that the field needs to be HTML encoded.
- Property CategoryAdapter — Select which tab the field (presented as a property) will appear in within a property pane.
- Property FormAdapter — Specify a custom data entry form for use in a property pane.
- Property Label — Specify the text that appears in a property pane associated with this field.
- Sort Ascending — Determine the order of a sort on a Collection.
- Sort Connection Adapter — Choose the connection adapter for sorting a Collection of objects. After you choose the connection adapter, use the Sort Ascending property to determine the sort order.
- State — Dynamically hide, show, enable, and disable controls bound to this field at runtime.
- Track for Cancel — Restore the initial value of the field if notified that the parent dialog is canceled.
See Also
Runtime Type : Meta : Field
Adding a Field to a Class