Chat now with support
Chat with Support

Please note, you may experience access issues between 6am - 7am Eastern time on Saturday, May 28 2022 due to planned maintenance

Foglight 5.9.1 - Web Component Guide

Introducing the Web Component Framework The Web Component Framework Configuring Views and Context Queries Functions Bindings Additional Components

Creating a Data Type in a Web Component Framework Module

Choose Types in the Definitions editor and select Add to create a new type.
The Add Type dialog box appears.
Select a super type for your new data object in the dialog box You can type a partial name in the Search Type text box and press Enter to filter the list of super types.

Data Object Types

Properties and Annotations can be specified for data object types.


At least one property must be defined. The following attributes may be set.

Name: The name of the property
Display Name: The localizable display name of the property. The value specified in the editor is used as the value for the base locale.
Data Type: The type of the property
List: Indicates whether the value of the property is a list or not.
Description: The localizable description of the property. The value specified in the editor will be used as the value for the base locale.
Reference: (Only applicable to properties of a data object type.) Whether the value of the property is a reference to a Data Object that exists somewhere else. For properties of an enum type, Reference is always true.
Default Value: The default value for the property. Only supported for non-list properties of a primitive type that the Web Component Framework can persist. For enum property types, this is supported if Type has the keyProperty annotation set.
Annotations: For editing the property Annotations. When you click on the edit icon, a dialog box is displayed showing the available annotations. The listed annotations depend on the super type of the type. If you hover the cursor over the name of an annotation in the table, the description of the annotation is shown in a tooltip. See Code Annotations below for more information about annotations for data objects of the Writable Data Object type.

Some of the annotations for the WritableDataObject type (for example, Expression and Validator) are executed as a script, as JavaTM code, or as a WCF function depending on the value of the corresponding annotation Type (for example, Expression type and Validator type).

TIP: Select JavaTM or Function as the type in cases where you want WCF to execute the annotation by referencing logic that is stored elsewhere (a reusable portion of code). Select Script when you do not require this type of re-use and it serves your needs to execute the annotation as a single-use script.

You can specify a Java method as the value of an annotation. When an annotation refers to a Java method, use the following syntax to specify it:

The method you specify must accept a single parameter of the following type:

If an annotation is a script, the value that you specify for the annotation is the name of the script.

You can use the following special variables with script annotations; they are available for use when the script is run:

object: The WritableDataObject instance whose annotation is being evaluated.
property: The property that is acted upon. For example, for Expression, the property being evaluated.
specificTimeRange: The current specific time range.
helper: The instance of WritableDataObjectHelper that the script can use.

If an annotation is a function, the value that you specify for the annotation and should be executed is the fully qualified ID of a WCF function. See Functions for more information.


The annotations of the type may be edited. Mousing over the name of an annotation in the table causes a tooltip to be shown containing the annotation's description. Each annotation value can be edited or set to Inherit, which means that the value of the annotation is inherited from the corresponding annotation of the super type.

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating