--
PedroRio - 01 Feb 2011
XEO Object Model Reference - Attribute Base Reference
This page contains a reference of properties that are applicable to all attributes types in a XEO Object Model.
Name
The name of the attribute. It's a required field and its value can be anything that it's not a SQL reserved word, as it's the name of the attribute that will be used to create the corresponding column in the database table. When using XEO's Java API, this is name to use when doing something like the following (assuming an attribute named "description").
boObject myObj = //retrieveObject code
myObj.getAttribute("description").getValueString()
_
Label
The label of the attribute. It's used especially with the XEO Web Components layer in forms to edit instances of the XEO Object Model and in lists of instances (the label of a given column). It's also a required attribute.
Description
A description of the attribute, essentially used as documentation about the attribute.
Tooltip
A tooltip to be displayed along side the attribute when it's rendered in a form (at the present time it's not implemented in the XWC layer).
Attribute Behavior
This section groups all common attribute properties that are related to the attribute's behavior.
Required
Whether the attribute is required or not. If an attribute is required, every instance of a given Object Model which has a required attribute cannot be saved until the attribute has a value.
The required property can be set using
BOL, the
Java API , or boolean values ("1" and "0", for true and false respectively). Using boolean values, will make it that the attribute is always or never required. By using BOL or the Java API you can make it that the attribute is only required under some specific conditions.
When an attribute is displayed in a form, if it's required the label will be displayed in red.
onChangeSubmit
The onChangeSubmit property, makes it that when this attribute is changed it triggers a new request to the server (only works in connection with the XWC layer). Making it possible to trigger anything that is dependent on the value of this attribute.
Default Value
The default value property allows you to create a rule to fill the value of the attribute when a new instance is created.
The default value can be set using BOL, the JAVA API or boolean values.
(XEO Studio - Dependents não funcionam)
Valid
Allows you to create a rule to check whether or not the value of the attribute is valid. The value returned by the verification rule must be true/false, and you can use BOL/Java to create such a rule. When the validate operation on a given instance is called, this method is also called and the instance cannot be saved if it has errors.In other words, when trying to validate an instance, every attribute will run its valid method to determine if its value is valid, if any of the attributes is invalid
(XEO Studio - Dependents não funcionam)
Formula
Allows you to define a formula to calculate the value of the attribute. The formula only works when you declare dependencies on other attributes. The formula can be defined using BOL or Java code.
The formula may depend on other attributes, which are declared using XEO Studio's edit interface. When any of those attributes changes its value the formula of this attribute will be triggered.
Disable When
The "disable when" property allows you to declare when the attribute is disabled (i.e. its value cannot be changed). You can set the conditions using BOL, Java or Boolean values. This property will also affect forms created using the Web Components layer, by disabling the field to edit the value. Naturally, when an attribute is disabled you cannot edit its value either with the Java API.
The "disabled when" property can also be dependent on the value of other attributes.
Hidden When
The hidden when feature is very closed connected to the Web Components layes and allows you to declare a rule for when this attribute should not be rendered in the viewer.
This feature can also be dependent of the value of other attributes
Text Index
The text index property allows you to control the index behavior regarding this attribute
_
Events
Every attribute can respond to certain events and trigger an action when that event occurs. The types of events vary with the type of attribute, but as explained in the
XEO Concepts section, there are the following types of events:
Regular Events (common to all types of attributes):
- OnBeforeGetValue (Triggered before a value is loaded into the attribute)
- OnAfterGetValue (Triggered after the value is loaded into the attribute)
Collection Events (only applicable to collection attributes):
- OnBeforeAdd (Triggered before an object is added to the collection)
- OnBeforeLoadBridge (Triggered before the collection is loaded)
- OnBeforeChangeOrder (Triggered before an object in a collection is moved inside the collection, when it changes the order of the object)
- OnBeforeRemove (Triggered before an object is removed from the collection)
- OnAfterAdd (Triggered after an object is added to the collection)
- OnAfterLoadBridge (Triggered after the collection is loaded)
- OnAfterChangeOrder (Triggered after an object is moved inside the collection, when it changes the order of object)
- OnAfterRemove (Triggered after an element is removed from the bridge)
Common Events (applicable to every type of attributes, except collection attributes):
- OnBeforeChange (Triggered before the attribute is actually changed)
- OnAfterChange (Triggered after the attribute is actually changed)
Attribute events
can only be defined using the Java API.
Database
The database property allows you to control several database-related properties of the attribute. Namely,
- Correct
FieldName - The name of the column????
Unique - If checked, creates a unique constraint in the column
Indexed - If checked, creates an index in the column
Contraint - If checked, and if it's an object/collection attribute, creates a foreign key constraint between the tables (???)
Index Full - If checked the attributes is indexed by the Text Indexer
Tabled -
Binding -
_