Child pages
  • Specification (.spec file)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For component type, specify whether component should be added to elements scope. Default is false, so component can be accessed only via component property. If true, will be accessible like any other element of the form.

Default / Initial / Predefined values

A property can have a "default" value like:

Code Block
languagejs
"text": { "type": "string", "default": "I am a button" }

But this would mean that restore to default or empty the property would always set that default property back. This is wanted behavior if the property has to have some default value like if a property must be 1 of a few values and the default is one of those.But for a button or label that by default you want some text in it, the default value is not really usable (the label text should be able to be nothing, only an image should be shown). For this we

have the attribute initialValueIf a property should allow the developer to choose in the properties view from a predefined set of values you can use the "values" attribute in combination with default (default can be one of the predefined values but can also be something else):

Code Block
languagejs
 "texthorizontalAlignment": {
    "type": "tagstringint",
    "tags": { "scope": "design" },
    "values": [
        { "LEFT": 2 },
        { "CENTER": 0 },
        { "RIGHT": 4 }
    ],
    "default": -1
}

 

But for a button or label in which you initially want some text, but reverting should really clear the text, the default value is not really usable (the label text should be able to be nothing, in case only an image is meant to be shown in that label). For this we have the attribute "initialValue":

Code Block
languagejs
 "text": { "type": "tagstring", "initialValue": "Button text", "tags": { "directEdit": "true" } }

This is like a constructor value, set only once when the component is createdadded.

Security

Components can be protected using two special security types: visible and protected.

...