Provided property value types
Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | Boolean value, either true or false | ||||||||||
border | CSS border string representation | ||||||||||
byte | A number, 8 bit unsigned | ||||||||||
color | String color value
| ||||||||||
dataprovider | Reference to a dataprovider, either a record or scope/form variable. Can be a complex definition if it needs to support onDataChange
In order for dataprovider typed properties to 'push' their value changes to the server (so changes in the browser to end up in records or scope/form variables) you must either use autoApply or directly apply / startEdit. If you do not 'apply' (auto or manually) the change, the updates will not be sent to server.
Simple example of read-only dataprovider:
Simple example of read-write dataprovider (with auto-apply):
| ||||||||||
date | Date value | ||||||||||
dimension | Dimension representation
| ||||||||||
double | A floating point number | ||||||||||
float | A floating point number | ||||||||||
font | CSS font string | ||||||||||
form | URL string pointing to a form (like tab in tabpanel) | ||||||||||
format | Format string. Requires to be specified as object to specify which dataprovider/valuelist property to map this format property on. For property can also contain an array of properties (will be applied to first one which is defined).
| ||||||||||
function | Callback function information that can be called on server from client. | ||||||||||
int | An integer number | ||||||||||
insets | Padding insets representation
| ||||||||||
labelfor | Type for labelfor property of the label. | ||||||||||
long | A number, size is twice an integer | ||||||||||
media | Reference to a Media entry. Media can be specified in different ways (plain bytes, media url, media id). | ||||||||||
relation | Reference to a Relation | ||||||||||
runtimecomponent | The type of component (so that components can be passed as parameters) | ||||||||||
protected | boolean security property, can be used to protect the entire component or specific properties or handlers in the component. Configuration:
| ||||||||||
point | Point representation
| ||||||||||
object | Generic type. | ||||||||||
scrollbars | An integer value which represents scrollbar definition. This type is used for designer to display special editor. | ||||||||||
short | A number, 16 bit | ||||||||||
string | Plain string property. I18n keys will be resolved by default. | ||||||||||
styleclass | String with space separated CSS classnames.Possible values supported by the component can be specified as hint for the developer
| ||||||||||
tabSeq | Tab sequence integer value. See sablo-tabseq | ||||||||||
tagstring | String property that can contain %%tags%%, i18n keys or <html>. It can also be a simple static string. Examples:
Here is how this type of property can be configured in the component's .spec file:
or simply (to use default config values):
| ||||||||||
valuelist | Reference to a ValueList | ||||||||||
visible | boolean security property, when set to false the component is protected from client data changes and function calls, data changes from the server are not sent to the client
|
Property value type modifiers:
Modifier | Description | Applicable for type | ||
---|---|---|---|---|
tags | Different tags can be defined on type: scope: Restricts the model property to: 'design', 'runtime' or 'private'. Design means property can only be assigned from designer (not from scripting). Runtime means the property cannot be assigned from designer (will be hidden in Properties View). Private is an internal property, that should only be used by component itself (so component.js or component_server.js). Will not show in Properties View and cannot be assigned from scripting. directEdit: boolean One property of a component can be tagged as directEdit for designer, this way that property can be edited directly by double clicking the component (for example text property on label/button). | |||
values | Fixed values, can have real/display values.
| |||
default | Defines the default value being used. | |||
onDataChange | See dataprovider type | dataprovider | ||
for | Reference to another property. Can be value or array of values. |
Note: defaults now also get applied to the model. This might change. Best practice is to initialize the model properties with values in the directive's link method and specify the same values as defaults in the .spec file for proper display in Servoy Developer.
See also: