widgetdescriptor

Defines a custom widget. The widget descriptor contains two blocks denoted by <config> and <oglml> tags. The config section includes content to render the widget’s configuration page within PanelBuilder’s Edit Component dialog. The oglml block contains the content to create the widget itself.

The widgetdescriptor tag may be contained within a widgets block of an oglml document, in an external file or be served up via URL

Syntax

<widgetdescriptor id="widget-id" baseurl="URL-string" structtype="structtype">

<config/>

<oglml/>

</widgetdescriptor>


 

Attributes

Attributes

Values

Restrictions

Description

id

String

Must be unique

Widget identifier.

structtype

String

 

Specifies a dependency of the widget upon a global struct parameter with matching structtype. Currently this type checking is restricted only to PanelBuilder UI; a custom widget will only be available in PanelBuilder if a parameter exists with matching structtype.

baseurl

String

Must be a valid, fully qualified URL.

When specified, the widget descriptor will be fetched from a document specified by the URL, rather than inline.

See Also

widget

config

param

Examples

The following creates a custom widget which displays four alarm dots in a 2x2 grid. The strings that sit beside each dot are configurable parameters of the widget.

<widgetdescriptor id="alarmgrid">

<config>

    <params>

       <param access="1" type="STRING" oid="str1" name="String 1"/>

       <param access="1" type="STRING" oid="str2" name="String 2"/>

       <param access="1" type="STRING" oid="str3" name="String 3"/>

       <param access="1" type="STRING" oid="str4" name="String 4"/>

    </params>

</config>

<oglml>

    <simplegrid cols="2" rows="2">

       <param oid="str1" widget="12" width="200" height="40"/>

       <param oid="str2" widget="12" width="200" height="40"/>

       <param oid="str3" widget="12" width="200" height="40"/>

       <param oid="str4" widget="12" width="200" height="40"/>

    </simplegrid>

</oglml>

</widgetdescriptor>

 


 

The following retrieves a widget descriptor from a web server:

<widgetdescriptor baseurl="http://mydevice/files/widgets.widgetdescriptor"/>

The widget is then displayed with the following:

<widget widgetid="alarmgrid" top="100" left="100"/>

The following example displays the widget, overriding the value of parameter str2 with the value “New String Value”:

<widget left="100" top="300" widgetid="alarmgrid">

<config>

    <params>

       <param oid="str2" value="New String Value"/>

    </params>

</config>

</widget>