Skip to main content

panelsBuilt

Fires when the SDK has finished building its panel configuration for the current event.

Description​

Observable field that notifies the host application when the SDK has finished constructing its panel configuration. Use this event as the signal to call fetchMaestroModule() — calling that function before panelsBuilt fires returns an empty array.

Type​

boolean

Usage​

m.lib.observeField("panelsBuilt", "handlePanelsBuilt")

sub handlePanelsBuilt()
modules = m.lib.callFunc("fetchMaestroModule")
if modules = invalid or modules.count() = 0 then return

for each moduleNode in modules
for each field in moduleNode.fieldsToObserve
moduleNode.observeFieldScoped(field, "handleModuleEvents")
end for
m.top.appendChild(moduleNode)
end for
end sub

Example​

' Set up the observer before setting config to avoid a race condition
sub setupObservers()
m.lib.observeField("panelsBuilt", "handlePanelsBuilt")
m.lib.observeField("trackingEvent", "onTrackingEvent")
m.lib.observeField("errorInformation", "onErrorInformation")
end sub

sub handlePanelsBuilt()
if m.lib = invalid then return
modules = m.lib.callFunc("fetchMaestroModule")
for each moduleNode in modules
if moduleNode = invalid then continue for
for each field in moduleNode.fieldsToObserve
moduleNode.observeFieldScoped(field, "handleModuleEvents")
end for
m.top.appendChild(moduleNode)
end for
end sub

Notes​

  • Set this observer before setting config — the SDK may finish building panels before your observer is registered otherwise.
  • panelsBuilt fires once per SDK session. If the event changes (via userDidStartWatchingEvent), it fires again when the new panels are ready.
  • See fetchMaestroModule() for the full module mounting workflow.