You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extend/develop/using-host-dialog.md
+60-64Lines changed: 60 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ai-usage: ai-assisted
8
8
monikerRange: '<= azure-devops'
9
9
ms.author: chcomley
10
10
author: chcomley
11
-
ms.date: 07/02/2025
11
+
ms.date: 11/14/2025
12
12
# customer-intent: As an Azure DevOps extension developer, I want to create modal dialogs that block user interaction with the entire page so I can collect user input, display forms, and provide focused user experiences in my extensions.
13
13
---
14
14
@@ -29,8 +29,6 @@ Use modal dialogs in your extensions to:
29
29
30
30
## Prerequisites
31
31
32
-
Before you can create modal dialogs in your Azure DevOps extension, ensure you have the following:
33
-
34
32
| Category | Requirement | Details |
35
33
|----------|-------------|---------|
36
34
|**Extension setup**| Working extension project | A valid `vss-extension.json` manifest file |
@@ -42,7 +40,7 @@ Before you can create modal dialogs in your Azure DevOps extension, ensure you h
|| Extension API | Install: `npm install azure-devops-extension-api`|
44
42
|**Extension permissions**| Manifest scopes | Include appropriate scopes in `vss-extension.json`, for example: `"vso.work"`, `"vso.project"`|
45
-
|**SDK imports**| Required modules | Import SDK and services: `import * as SDK from "azure-devops-extension-sdk"`and `import { CommonServiceIds, IHostDialogService } from "azure-devops-extension-api"`|
43
+
|**SDK imports**| Required modules | Import SDK and services: `import * as SDK from "azure-devops-extension-sdk"`|
46
44
47
45
## Dialog contents
48
46
@@ -140,78 +138,76 @@ The `uri` property references a page that is rendered within the content area of
140
138
141
139
## Show the dialog
142
140
143
-
To show the dialog (for example, when a user selects an action on a toolbar or menu), call the `openDialog` function on an instance of the HostDialogService, passing the fully qualified identifier of the dialog content, for example `my-publisher.my-extension.registration-form` and any dialog options:
141
+
To show the dialog (for example, when a user selects an action on a toolbar or menu), call the `openDialog` function on an instance of the HostDialogService:
A function can be called when the OK button is selected. This function is specified by `getDialogResult` in the options you provide when showing the dialog.
164
+
A function can be called when the OK button is selected. You specify this function by setting`getDialogResult` in the options you provide when showing the dialog.
167
165
168
166
If a call to `getDialogResult` returns a non-null value, this value is then passed to the function specified by `okCallback` (also in the options) and the dialog is closed.
169
167
170
168
In this example, the `attachFormChanged` callback gets called when inputs on the form change. Based on whether the form is valid or not, the OK button is enabled or disabled.
0 commit comments