14.1 Widgets

The primary interface to include 3rd party controls or making use of external JavaScript in Visual LANSA is achieved through the use of Widget components.

A Widget is a LANSA control that formalizes the 3rd Party script making it easy to use, and re-use, in RDMLX. The Widget Type, either a control or and an object, determines its implementation at runtime.

Control widgets (#PRIM_WDGT.Control) are visual widgets. In HTML terms a Control Widget will result in a DIV element being created when the Widget is used on a Web Page or Reusable Part. The DIV tag is just a container that encapsulates other elements and divides the HTML document into sections. In the context of the Widget, the DIV is made available for whatever the JavaScript wants to show.

Object Widgets (#PRIM_WDGT.Object) are non-visual widgets. They can be used to wrapper JavaScript objects, allowing them to be used in RDMLX.

Widgets are designed to have similar structure and use as a component. They have properties to define their state, methods to perform actions and they can fire events so that the RDMLX can respond to changes in their state or user activity. Defining the appropriate properties, events and methods in the Widget allows the 3rd party script to be addressed in RDMLX as if it were a LANSA defined feature.

Each of the properties, events and methods defined in the Widget will be associated with a JavaScript function that will implement the functionality required to interface with the 3rd party control.

Several Widgets are shipped with the LANSA and can be used as a reference point if you need to create your own.

Any external Scripts required by a Widget must be added to the Resources tab of the Widget.