3.5.13Opening widgets in dialogs

A widget, script, or UDIX can display one of the platform's widgets in a dialog. For example:

// Open the calendar widget

Framework.CreateDialog({
type: "calendar",

context: {} // Optional. See below.
});

But, most commonly, you will want to open the widget in a "modeless" dialog, where the user can continue to do other things while the widget window remains open. You will also typically then want the dialog to survive after its creator terminates. For example:

Framework.CreateDialog({
type: "calendar",
context: {}, // Optional. See below.
noParent: true, // Survive closure/termination of parent widget/script/UDIX
disposition: "floating" // Modeless dialog
});

Note: displaying a trading chart is a special case, because of the range of options and the potential complexity. Displaying (and embedding) trading charts is covered in a separate section.

The following is a list of the most common types of widget which you may want to open. This list is obviously non-exhaustive, and may be extended in future. The full list can depend on the broker platform, and can include broker-specific features such as a contact-us widget.

Note: there is no fully standardised naming convention. Some widget type values are hyphenated, such as account-history, and others, such as accountmetrics, are not.

type value

Description

calendar

Calendar widget

accountmetrics

Account metrics

trades

Trade list

quoteboard

Quote board

account-history

Account history

technicals

Technical analysis widget - see notes below on context

market-overview

Overview of a single market - see notes below on context

chart

Trading chart - see separate section

Some widgets, such as the Technical Analysis (type: "technicals"), display a specific market and/or timeframe, and can be given context:{} which controls their initial display. For example:

Framework.CreateDialog({
type: "technicals",
// Tell the widget to initialise itself with GBP/USD D1

context: {

instrumentId: "GBP/USD",

timeframe: 86400

},

noParent: true, // Survive closure/termination of parent widget/script/UDIX
disposition: "floating" // Modeless dialog
});

Any context:{…} in the call to CreateDialog() is simply ignored by a widget which does not support it.

The effect of context can be slightly subtle in some widgets. For example:

// Opens the trade list, with initial filtering so that it only displays GBP/USD trades

Framework.CreateDialog({
type: "trades",
context: {

instrumentId: "GBP/USD"

},

noParent: true,
disposition: "floating"
});

// Opens the calendar with initial filtering so that it only displays items which are

// relevant to USD/JPY (currency associated with event is either USD or JPY)

Framework.CreateDialog({
type: "calendar",
context: {

instrumentId: "USD/JPY"

},

noParent: true,
disposition: "floating"
});