Page History
...
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):
| ||||||||||||||||||||||||||||||||||||||||||||
dataset | JSDataSet type equivalent. Currently can be used only for runtime api or model (to send a dataset to client).
The type cam have two configuration properties: 1. includeColumnNames , default false, will also send the column names as a separate array to client as the first row 2. 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
| ||||||||||||||||||||||||||||||||||||||||||||
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 Given an object in the .spec file - to be specified as object able to specify which dataprovider and/or valuelist property to map this format property on. For property The 'for' value can be one property name (pointing to a dataprovider-type property or a valuelist property), but it can also contain an array of 2 properties (will be applied to first one which is defined). Code Block | | |||||||||||||||||||||||||||||||||||||||||||
|
Code Block | ||||
---|---|---|---|---|
| ||||
myFormatProp : { type: 'format', for: 'myDataProviderProp' } |
Code Block | ||||
---|---|---|---|---|
| ||||
myFormatProp : { type: 'format', for: ["myValuelistProp", "myDataProviderProp"] } |
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.
Callback function information that can be called on server from client.
A callback function set for this type of property will be represented in the component model as a pair of "formname" and "script" that can be used as parameters for "$window.executeInlineScript" to execute it.
Example:
in the component spec
Code Block |
---|
"model": { "myFunction" : { "type": "function"} }, |
in the component js implementation
Code Block |
---|
$window.executeInlineScript($scope.model.myFunction.formname, $scope.model.myFunction.script, [arg1, arg2]); |
Note that the component need to have reference to the "$window" service, and the "formname" and ''script" values are already encrypted in the model, and you need to use those values, and not plain text values for formname and script. Arguments for the callback can be set using the last parameter of "$window.executeInlineScript"
Padding insets representation
Code Block | ||
---|---|---|
| ||
{ paddingTop: 10px, paddingLeft: 20px, paddingBottom : 10px, paddingRight: 10px } |
boolean security property, can be used to protect the entire component or specific properties or handlers in the component.
Configuration:
setting | description | example |
---|---|---|
for | list of properties to protect, when not specified the entire component is protected | "for": ["streetname", "updateInfoFunc"] |
blockingOn | when the property is set to this value, protection is active, default: true | "blockingOn": true |
Code Block | ||||
---|---|---|---|---|
| ||||
"enabled" : { "type": "protected", "blockingOn": false, "default": true } |
Point representation
Code Block | ||
---|---|---|
| ||
{ x: 10, y: 20 } |
String with space separated CSS classnames.Possible values supported by the component can be specified as hint for the developer
Code Block | ||
---|---|---|
| ||
{ type:'styleclass', values:[ 'btn', 'btn-default', 'btn-lg', 'btn-sm', 'btn-xs' ] } |
String property that can contain %%tags%%, i18n keys or <html>. It can also be a simple static string.
Will be pre-processed before being provided to web component depending on configuration options below.
Examples:
Code Block | ||
---|---|---|
| ||
Hello %%name%%, welcome to %%i18n:com.mycompany.mykey%% ... or i18n:com.mycompany.mykey or <html>...some html that can also contain JS callbacks and media...</html> or just some static string |
Here is how this type of property can be configured in the component's .spec file:
Code Block | ||
---|---|---|
| ||
myTextProperty : { "type" : "tagstring", "displayTagsPropertyName" : "myDisplaysTagsProp", // default is null. // If specified then the property will initially read the // boolean value of the property with given name; If that // property is true, tags (%%x%%) will be replaced, otherwise // they will be ignored (in which case it will just replace i18n // and html); if null, tags will be replaced or not based on // config option "displayTags" "displayTags" : false, // default is true. If displayTagsPropertyName // is non-null it will be ignored. Otherwise, only if true this // property will parse tags (%%x%%) "useParsedValueInRhino" : true, // default is false. Server side // scripting read/modify will work with: if false the parsed // (with tags/i18n already replaced, so static) value, if true // the non-parsed (value containing %%x%% or i18n:..., which // will be after modify parsed) value "forFoundset" : "myFoundsetPropertyName" // optional; if specified // then on the client instead of one value you will get an array // of values one for each record in the viewport of given // foundset property (see also 'foundset' property type) }, displaysTags : { "type" : "boolean", "scope" : "design" } // needed only // if "displayTagsPropertyName" is used as above |
or simply (to use default config values):
Code Block | ||
---|---|---|
| ||
myTextProperty: "tagstring" |
Reference to a ValueList.
Configuration (.spec file)
setting | description | example |
---|---|---|
lazyLoading | Added in 8.2 : Setting for Global Method Valuelists only (does not affect any other type of valuelist); it helps not load values on initial display (if not needed), but only when they are really needed. "Lazy loading" must be set on the Valuelist - in the Valuelist Editor as well, otherwise it has no effect. Default and bootstrap typeahead components have this configuration set to true (default is false). | "lazyLoading" : true |
max | Allows limiting the number of items the valuelist will send to the browser. | "max":500 |
for | Allows you to provide a dataprovider-type property name (that this valuelist property will use to determine for example the type of the data - this is needed for some types of valuelist like custom valuelist) | for: "myDPProperty" |
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 only.
For example:
Code Block | ||
---|---|---|
| ||
// 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"]); |
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
setting | description | example |
---|---|---|
for | list of properties to protect, when not specified the entire component is protected | "for": ["streetname", "updateInfoFunc"] |
...