Property Types
This version of the Property Types page is meant for custom components / services creators. For a basic version that only details how these types can be used inside Servoy solutions, see this page instead.
Not all property types are really meant for usage as API method parameters. Some of them are really meant for model property types only. Examples: dataprovider, tagstring (normal string will translate i18n, tags can't be resolved through api), media and valuelist (create a dataset out of a valuelist and with application.getValueListItems("vlname")), ...
Provided property value types
boolean
border
clientfunction
color
dataprovider
dataset
date
dimension
double
font
form
format
foundset
foundsetInitialPageSize
foundsetRef
function
insets
int
JSEvent
labelfor
map
media
modifiable
object
point
protected
record
relation
rowRef
runtimecomponent
scrollbars
string
styleclass
tabseq
tagstring
titlestring
valuelist
valuelistConfig
visible
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.
For NG1 it works the same as a tagstring property type and you can run the code inside the browser. But for Titanium this is handled differently: the component gets a function that is retrieved in a way that the browser allows - directly from the model (instead of getting a string and do an eval(string) on it to generate the function). This difference is because in Titanium it is not allowed to do eval in the browser by default - Content Security Policy doesn't allow that for security reasons.
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 then - for a known possible sub-property/key that has 'clientfunction' type, this must be set in the .spec file of the component / service as a "value_types" tag on the map/json property type declaration; see map for an example.
If, for a 'map' or 'json' typed value, the sub-property/key that is supposed to be a 'clientfunction' is not set in the .spec file correctly (that it should be seen as a 'clientfunction') - or if you need to use it in a plain 'object' type - then this can be done correctly in Titanium through code, by creating a client side BrowserFunction explicitly - see clientutils.generateBrowserFunction(...)
color
String color value
Example:
dataprovider
Reference to a dataprovider, either a record or scope/form variable.
Can become a complex definition if it needs to support onDataChange, it needs to be able to send changes to server or display tags.
The ondatachange handler will receive as parameter the old datarovider value, the new dataprovider value and a JSEvent.
Starting with 2021.06 release the JSEvent.data will contain an object: {dataprovider : dataProviderID, scope : dataproviderScope, scopeid : variable_scope_or_datasource}.
Definition:
Starting with 8.4, if 'forFoundset' above is used, then the client-side (in browser) value also provides two methods: addChangeListener / removeChangeListener. So you can add a listener that will receive updates (row insert/delete/change or full viewport update) similar to how the change listener in foundset property type works. Remember to always remove any added change listeners when the component's $scope is destroyed - similar to what is described in the link for the foundset property type listener.
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.
IMPORTANT In order to be able to change server-side dataprovider values using apply or svy-autoapply, the .spec file must declare that dataprovider property from the model as pushToServer: allow or higher. Otherwise the server will reject the dataprovider value updates and log a change denied warning.
Simple example of read-only dataprovider: .spec
.html
In server-side (solution) scripting, accessing a dataprovider property - for example "elements.myField.myDataprovider" - will yield a string: the dataprovider id (name of variable/column). You can also assign a dataprovider id (string) to that property.
Client side, the value of a dataprovider property depends on the actual value of the dataprovider (column/variable/...) as well as the type of the dataprovider (is it a number in the database, or a blob / string / date etc.).
For primitives dataprovider types, it will be the primitive value. For date dataprovider types, it will be a Date object on client.
For MEDIA typed dataproviders the client-side value depends on the server side value's content:
if the value is a BLOB / byte array then client-side you will get an object with two keys: { url: ... , contentType: ... } that can be used to load that content in the browser
if the value is a date, you will get a Date on client
if the value is a string:
if it starts with "media:///" it will be an URL string on the client that points to that server side media resource from the solution
other strings will be treated as strings
primitive types will just be sent 'as-is' to client
dataset
JSDataSet type equivalent. Currently can be used only for runtime api or model (to send a dataset to client).
Example
The type can have two configuration properties:
includeColumnNames , default false, will also send the column names as a separate array to client as the first row
columnTypes can specify some column types which will be used for converting the value to send client side, this is needed for non basic columns/types
date
Date value
dimension
Dimension representation
Example
double
A floating point number
findmode
This property is for handling the find mode for a component (if the component needs to react spefic to findmode, like no formatting, allowing any kind of input) See