Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

 

Provided property value types

 

TypeDescription
stringPlain string property
tagstring

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:

Example
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>

Here is how this type of property can be configured in the component's .spec file:

Example
myTextProperty : {
	"type" : "tagstring",
	"displayTagsPropertyName" : "displaysTags", // 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
},
displaysTags : { "type" : "boolean", "scope" : "design" } // needed only if
              // "displayTagsPropertyName" is used as above

or simply (to use default config values):

Example
myTextProperty: "tagstring"
color

String color value

Example
#FFFFFF
point

Point representation

Example
{
	x: 10, 
	y: 20
}
dimension

Dimension representation

Example
{
	width: 100, 
	height: 20
}
insets 
fontCSS font string
borderCSS border string
booleanBoolean value, either true or false
styleclass

String with space separated CSS classnames.Possible values supported by the component can be specified as hint for the developer

Example specifying special classnames supported by the component as hint for the developer
{
	type:'styleclass', 
	values:[
		'btn',
		'btn-default',
		'btn-lg',
		'btn-sm',
		'btn-xs'
	]
}
doubleA floating point number
floatA floating point number
intAn integer number
longA number, size is twice an integer
shortA number, 16 bit
byteA number, 8 bit unsigned
dataprovider

Reference to a dataprovider, either a record or scope variable. Can be a complex object for supporting onDataChange

Example
{ 
	type:'dataprovider', 
	ondatachange: { 
		onchange: 'onDataChangeMethodID', 
		callback: 'onDataChangeCallback'
	}
}
valuelistReference to a ValueList
formURL string pointing to a form (like tab in tabpanel)
format

Format string. Requires to be specified as object to specify which dataprovider property to map this format property on

Example
{
	for: 'dataProviderID',
	type: 'format'
}
relationReference to a Relation
mediaReference to a Media entry
dateDate value
scrollbars..
tabSeq..
protected

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

Configuration:

settingdescriptionexample
for

list of properties to protect,

when not specified the entire component is protected

"for": "streetname, updateInfoFunc"
blockingOnwhen the property is set to this value, protection is active, default: true"blockingOn": true
Example
 "enabled" : { "type": "protected", "blockingOn": false, "default": true }
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

settingdescriptionexample
for

list of properties to protect,

when not specified the entire component is protected
"for": "streetname, updateInfoFunc"

 

Property value type modifiers:

ModifierDescriptionApplicable for type
scopeRestricts the model property to either 'design' or 'runtime' 
values

Fixed values, can have real/display values.

Example with display and real values
[{"LEFT":2}, {"CENTER":0},{"RIGHT":4}]
Example with plain values
[
    'btn',
    'btn-default',
    'btn-lg',
    'btn-sm',
    'btn-xs'
]
 
defaultDefines the default value being used. 
onDataChangeSee dataprovider typedataprovider
forSee format typeformat

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:

  • No labels