Property Types

This version of the Property Types page is meant for developers who use components / services in their Servoy solutions. For an advanced version, that details how these types can be used when creating custom components / services, see this page instead.

Provided property value types

boolean

Boolean value, either true or false

border

CSS border string representation

clientfunction

This property type must be used in Titanium if the value of the property represents a javacript function that has to run client side. In NG1 (tag)string property type was used for this purpose, but for Titanium NG Client we must know when it is meant to be a client side javascript function rather then a simple string (due to Content Security Policy - security reasons). It is still a string at design time in both cases.

Starting with version 2023.09, it is supported to use clientfunction(s) in the designer (input is still a simple string input) not just in properties typed that way in the component but also inside pure map or json property type values - but only if the component/service typed that sub-property/key correctly.

If, for a 'map' or 'json' typed value, the component/service did not type the sub-property correctly, but you still need to add that client side function to it - or if the component just uses a plain 'object' type where you need that client side function - then that can be done correctly in Titanium through the solution's code, by creating a client side BrowserFunction explicitly where you need it; see clientutils.generateBrowserFunction(...)

color

String color value

Example:

#FFFFFF

dataprovider

Reference to a dataprovider, either a record or scope/form variable.

Changing a dataprovider will trigger onDataChange event.

dataset

JSDataSet type equivalent. Currently can be used only for runtime api or model (to send a dataset to client).

date

Date value

dimension

Dimension representation

Example

{
    width: 100, 
    height: 20
}

double

A floating point number

findmode

This property is for handling the find mode for a component (if the component needs to react specific to findmode, like no formatting, allowing any kind of input)

font

CSS font string

form

URL string pointing to a form (like tab in tabpanel)

format

Format string.

Format property access from solution scripting will give the string value of the parsed format** . Assignment** to a 'format' typed property allows you to set a new format string.

foundset

Represents a foundset. Used to interact with a server-side foundset from the browser (component properties can have this type). Accessible (if the component allows it) in server-side solution scripting and in properties view - when designing forms as well.

foundsetRef

A reference to a server side foundset. Can be used in handlers (or for internal implementation details by custom component creators).

function

Callback function / function information that can be called on server from client.

insets

Padding insets representation

Example

{
    paddingTop: 10px, 
    paddingLeft: 20px,
    paddingBottom : 10px,
    paddingRight: 10px
}

int

An integer number

JSEvent

Type used in handlers that offers context information for the event.

labelfor

Type for labelfor property of the label.

map

A map of key/value pairs. It's main purpose is converting string values, like "true"/"false" to boolean types, numbers as strings to number types (useful when using developer's properties view to assign values), and supporting i18n tags as values. It mostly supports primitive values, it does support nested structures since Servoy 2023.09 in the designer but only if those specific keys are marked like that through the "tags" spec attribute adding there an "value_types" entry, this is also needed to mark certain keys as clientfunction, for more full support of pure json with fully nested structurs look at the json property type

currently value_types can only have "map" or "json" as nested structures and "clientfunction" as the special value type that needs to be process specially.

json

This is like a map property type it has the same runtime behavior but it is more relaxed in what you can type in the designer, because that is a free textfield for a complete json definition. The json property type also has basic support for typing through arrays then the value_types is mapping on the objects inside the array

media

Reference to a Media entry. Media can be given in different ways on server (media name, media uuid, media url - for example "media:///servoy.jpg" -, media id).

object

Generic JSON type. When using this type, you should pass primitive values or objects/array of primitive values and objects/arrays - because it will generally not be able to handle correctly other types of values (for example you cannot give a foundset or a border and expect them to work). You should use more specific types from this list whenever possible instead of this generic type. The 'object' type relies on standard JSON to transfer it's contents to the browser; it tries to use some default conversions to make the value be a JSON-valid value (but the safest way is for you to give only what JSON allows as value).

point

Point representation

Example

{
    x: 10, 
    y: 20
}

protected

Boolean security property, can be used to protect the entire component or specific properties or handlers in the component.

modifiable

A security property, that can be used for nested data providers (like columns of a grid) - where some columns have a "dataprovider property type" that can be edited but some columns should not be editable. The dataprovider that it targets is specified by the component.

This property is a string property, so any non-null string can be set - if you want the attached data provider to be editable. But if you set a null value, then the server will not allow a change for that data provider.

record

Reference to a Record, can be used to send a record between client and server.

relation

Reference to a Relation (this is a string, so if used as a api parameter, this would just mean the relation name)

rowRef

**DEPRECATED Record type should be used instead.

runtimecomponent

The type of component (so that components can be passed as parameters)

scrollbars

An integer value which represents scrollbar definition. This type is used for designer to display special editor.

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.

tagstring

String property that can optionally contain %%tags%%, html with links to media files or it can be an i18n key. It can also be a just a simple static string. It will be pre-processed before being provided to the web component, depending on the configuration options.

titlestring

String property similar to tagstring, but with support to use as default value the title string form a table column. It has a setting key: "for", that contains the dataprovider property from where the table column would be determined.

valuelist

Reference to a ValueList. See ValueList Object Model and ValueList Guide for more information about a valuelist.

Supported properties in the spec are:

Valuelist property access from solution scripting will give the valuelist name. Assignment to a 'valuelist' typed property allows two types of values:

  • if you assign a String to it that will be interpreted as a valuelist name - and the valuelist with the given name is put in that property

  • if that property already contains a custom valuelist and you assign a Dataset to it then it will alter the items of the custom valuelist for that property of that element only.

Sample

// will output the name of the valuelist that is currently in "myValuelistProp"
application.output(elements.mycomponent.myValuelistProp);
 
// the following code would change the items of a custom valuelist inside one
// of the columns of a servoy-extra table component
elements.myExtraTable.columns[1].valuelist = databaseManager.convertToDataSet(
    new Array({ d: 'Item 1', r: 1}, { d: 'Item 2', r: 2},
              { d: 'Item 3', r: 3}, { d: 'Item 4', r: 4},
              { d: 'Item 5', r: 5}, { d: 'Item 6', r: 6}), ["d", "r"]);

valuelistConfig

Can be used to configure a valuelist's behavior (where applicable - mostly for typeahead components). It was added in 2023.06. Properties that can be configured from Properties View (on a property of valuelistConfig type):

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.

Last updated