Skip to content

Commit aca3b55

Browse files
committed
updates content and samples
1 parent c3df95c commit aca3b55

File tree

1 file changed

+41
-25
lines changed

1 file changed

+41
-25
lines changed

articles/azure-resource-manager/managed-applications/microsoft-common-textbox.md

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
---
22
title: TextBox UI element
3-
description: Describes the Microsoft.Common.TextBox UI element for Azure portal. Use for adding unformatted text.
3+
description: Describes the Microsoft.Common.TextBox UI element for Azure portal that's used for adding unformatted text.
44
author: davidsmatlak
5-
6-
ms.topic: conceptual
7-
ms.date: 03/03/2021
85
ms.author: davidsmatlak
9-
6+
ms.topic: conceptual
7+
ms.date: 08/23/2022
108
---
119

1210
# Microsoft.Common.TextBox UI element
1311

14-
A user-interface (UI) element that can be used to add unformatted text. The `Microsoft.Common.TextBox` element is a single-line input field, but supports multi-line input with the `multiLine` property.
12+
The `TextBox` user-interface (UI) element can be used to add unformatted text. The element is a single-line input field, but supports multi-line input with the `multiLine` property. You can also use a single-line text box as an input to the `ArmApiControl`.
1513

1614
## UI sample
1715

1816
The `TextBox` element uses a single-line or multi-line text box.
1917

20-
:::image type="content" source="media/managed-application-elements/microsoft-common-textbox.png" alt-text="Microsoft.Common.TextBox element single-line text box.":::
18+
Example of single-line text box.
2119

22-
:::image type="content" source="media/managed-application-elements/microsoft-common-textbox-multi-line.png" alt-text="Microsoft.Common.TextBox element multi-line text box.":::
20+
:::image type="content" source="media/managed-application-elements/microsoft-common-textbox.png" alt-text="Screenshot of the Microsoft.Common.TextBox element's single-line text box.":::
21+
22+
Example of multi-line text box.
23+
24+
:::image type="content" source="media/managed-application-elements/microsoft-common-textbox-multi-line.png" alt-text="Screenshot of the Microsoft.Common.TextBox element's multi-line text box.":::
2325

2426
## Schema
2527

@@ -75,34 +77,47 @@ The examples show how to use a single-line text box and a multi-line text box.
7577

7678
The following example uses a text box with the [Microsoft.Solutions.ArmApiControl](microsoft-solutions-armapicontrol.md) control to check the availability of a resource name.
7779

80+
In this example, when you enter a storage account name and exit the text box, the control checks if the name is valid and if it's available. If the name is invalid or already exists, an error message is displayed. A storage account name that's valid and available is shown in the output.
81+
7882
```json
79-
"basics": [
80-
{
83+
{
84+
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
85+
"handler": "Microsoft.Azure.CreateUIDef",
86+
"version": "0.1.2-preview",
87+
"parameters": {
88+
"basics": [
89+
{
8190
"name": "nameApi",
8291
"type": "Microsoft.Solutions.ArmApiControl",
8392
"request": {
84-
"method": "POST",
85-
"path": "[concat(subscription().id, '/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-04-01')]",
86-
"body": {
87-
"name": "[basics('txtStorageName')]",
88-
"type": "Microsoft.Storage/storageAccounts"
89-
}
93+
"method": "POST",
94+
"path": "[concat(subscription().id, '/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-09-01')]",
95+
"body": {
96+
"name": "[basics('txtStorageName')]",
97+
"type": "Microsoft.Storage/storageAccounts"
98+
}
9099
}
91-
},
92-
{
100+
},
101+
{
93102
"name": "txtStorageName",
94103
"type": "Microsoft.Common.TextBox",
95104
"label": "Storage account name",
96105
"constraints": {
97-
"validations": [
98-
{
99-
"isValid": "[basics('nameApi').nameAvailable]",
100-
"message": "[basics('nameApi').message]"
101-
}
102-
]
106+
"validations": [
107+
{
108+
"isValid": "[basics('nameApi').nameAvailable]",
109+
"message": "[basics('nameApi').message]"
110+
}
111+
]
103112
}
113+
}
114+
],
115+
"steps": [],
116+
"outputs": {
117+
"textBox": "[basics('txtStorageName')]"
104118
}
105-
]
119+
}
120+
}
106121
```
107122

108123
### Multi-line
@@ -148,3 +163,4 @@ This example uses the `multiLine` property to create a multi-line text box with
148163

149164
- For an introduction to creating UI definitions, see [CreateUiDefinition.json for Azure managed application's create experience](create-uidefinition-overview.md).
150165
- For a description of common properties in UI elements, see [CreateUiDefinition elements](create-uidefinition-elements.md).
166+
- To learn more about functions, see [CreateUiDefinition functions](create-uidefinition-functions.md).

0 commit comments

Comments
 (0)