Skip to main content

openBackgroundForm

Description

Loads and displays a background form as an overlay.

A background form appears as an overlay on top of the screen without a normal page transition, and stays in memory while the app runs. Calling it again with the same formPath redisplays the existing form instead of loading it again.

Parameters

ParameterTypeDescription
formPathStringPath of the form to open (for example, "group/myForm")
linkArgdynamicInitial argument passed to the form. Use "" or null if you don't need one
callbackJSFunction?Callback that receives the result value when the form closes. Use null if you don't need one

Returns

void

Notes

  • Reopening a form that is already loaded only shows it again — without a reload (the same effect as showBackgroundForm).
  • A background form stays in memory until you close it. To remove it completely, call closeBackgroundForm().
  • To only hide the form, use hideBackgroundForm().
  • ⚠️ Inside a background form, $form.close() does not work. Background forms are managed by the Overlay, not the Navigator stack. To close one from inside the form, specify its own path and call $app.closeBackgroundForm().
// Close the background form itself from inside it
$app.closeBackgroundForm("alarm/watcher", { ok: true });

Example

// Open the alarm watcher form in the background
$app.openBackgroundForm("alarm/watcher", null, function(result) {
$log.i("폼 종료 결과:", result);
});

// Pass an initial argument
$app.openBackgroundForm("group/myForm", { userId: 123 }, function(result) {
if (result.ok) {
$log.i("처리 완료");
}
});
  • $app.hideBackgroundForm(formPath) — Hides the UI (stays in memory)
  • $app.showBackgroundForm(formPath) — Shows a hidden form again
  • $app.closeBackgroundForm(formPath, result) — Closes the form and frees memory
  • $app.isBackgroundFormLoaded(formPath) — Checks whether it is loaded
  • $app.postMessageToBackgroundForm(formPath, name, data) — Sends a message to the form