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: powerapps-docs/developer/component-framework/add-custom-controls-to-a-field-or-entity.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,13 +22,13 @@ Code components let you transform fields that traditionally contain text into vi
22
22
23
23
## Add a code component to a field
24
24
25
-
Following the steps in this procedure will change the default label and text box field of the **Budget Amount** field to the slider code component on the Opportunity entity. You can use similar steps to replace an existing field with a code component or configure a code component for a custom field.
25
+
Following the steps below will change the default label and text box field of the **Budget Amount** field to the slider code component on the Opportunity entity. You can use similar steps to replace an existing field with a code component or configure a code component for a custom field.
26
26
27
27
1. Open solution explorer.
28
28
29
29
2. Expand **Entities**, expand the entity that you want, such as the **Opportunity** entity, select **Forms**, and then open a form such as the **Main** form.
30
30
31
-
3. In the form editor, double-click the field where you want to add a code component, such as the **Budget Amount** field on the opportunity main form. Alternatively, you can create a custom field.
31
+
3. In the form editor, double-click the field where you want to add a code component, such as the **Budget Amount** field on the opportunity main form. You can also create a custom field.
32
32
33
33
4. On the **Field Properties** page, select the **Controls** tab, and then select **Add Control**.
34
34
@@ -53,17 +53,17 @@ Following the steps in this procedure will change the default label and text box
53
53
> [!div class="mx-imgBorder"]
54
54
> 
55
55
56
-
-**Min**. Set the minimum accepted value. You can bind a static value that you enter or bind the value to an existing field. In this example **Bind to static value** is **Currency** and the minimum value that can be entered is *zero*.
56
+
-**Min**. Set the minimum accepted value. You can bind a static value that you enter or binds the value to an existing field. In this example **Bind to static value** is **Currency** and the minimum value that can be entered is *zero*.
57
57
58
58
-**Bind to a static value**. Select the data type, such as a whole number (Whole.None), currency, floating point (FP), or decimal. Next, enter a number that represents the minimum accepted value for the field.
59
59
60
60
-**Bind to values on a field**. Select a field from the list that will be used as the minimum accepted value.
61
61
62
-
-**Max**. Set the maximum accepted value for the field. Similar to the Min value, you can bind a static value that you enter or bind the value to an existing field as described earlier. In this example, **Bind to static value** is **Currency** and the maximum value that can be entered is **1 billion**.
62
+
-**Max**. Set the maximum accepted value for the field. Similar to the Min value, you can bind a static value that you enter or binds the value to an existing field as described earlier. In this example, **Bind to static value** is **Currency** and the maximum value that can be entered is **1 billion**.
63
63
64
64
-**Step**. This represents the unit to increment or decrement when adding to or subtracting from the current value. For example, for budget amount you can select 100 dollar increments\decrements.
65
65
66
-
-**Hide Default Control**. Selecting this option hides the component so neither the component or the data is displayed in any of the clients that don't support the code component.
66
+
-**Hide Default Control**. Hides the component so neither the component or the data is displayed in any of the clients that don't support the code component.
67
67
68
68
8. Select **OK**, to close the Field Properties page.
// reference to the control container HTMLDivElement
49
-
// This element contains all elements of our custom control example
50
-
private _container:HTMLDivElement;
51
-
// Flag if control view has been rendered
52
-
private _controlViewRendered:Boolean;
53
-
/**
54
-
* Used to initialize the control instance. Controls can kick off remote server calls and other initialization actions here.
55
-
* Data-set values are not initialized here, use updateView.
56
-
* @paramcontext The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped to property names defined in the manifest, as well as utility functions.
57
-
* @paramnotifyOutputChanged A callback method to alert the framework that the control has new outputs ready to be retrieved asynchronously.
58
-
* @paramstate A piece of data that persists in one session for a single user. Can be set at any point in a controls life cycle by calling 'setControlState' in the Mode interface.
59
-
* @paramcontainer If control is marked control-type='standard', it receives an empty div element within which it can render its content.
60
-
*/
61
-
public init(
62
-
context:ComponentFramework.Context<IInputs>,
63
-
notifyOutputChanged: () =>void,
64
-
state:ComponentFramework.Dictionary,
65
-
container:HTMLDivElement
66
-
) {
67
-
this._container=container;
68
-
this._controlViewRendered=false;
69
-
}
70
-
/**
71
-
* Called when any value in the property bag has changed. This includes field values, data-sets, global values such as container height and width, offline status, control metadata values such as label, visible, etc.
72
-
* @paramcontext The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped to names defined in the manifest, as well as utility functions
73
-
*/
74
-
public updateView(context:ComponentFramework.Context<IInputs>) {
// Reference to the control container HTMLDivElement
51
+
// This element contains all elements of our custom control example
52
+
private _container:HTMLDivElement;
53
+
54
+
// Flag if control view has been rendered
55
+
private _controlViewRendered:Boolean;
56
+
57
+
/**
58
+
* Used to initialize the control instance. Controls can kick off remote server calls and other initialization actions here.
59
+
* Data-set values are not initialized here, use updateView.
60
+
* @paramcontext The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped to property names defined in the manifest, as well as utility functions.
61
+
* @paramnotifyOutputChanged A callback method to alert the framework that the control has new outputs ready to be retrieved asynchronously.
62
+
* @paramstate A piece of data that persists in one session for a single user. Can be set at any point in a controls life cycle by calling 'setControlState' in the Mode interface.
63
+
* @paramcontainer If a control is marked control-type='starndard', it will receive an empty div element within which it can render its content.
64
+
*/
65
+
public init(context:ComponentFramework.Context<IInputs>, notifyOutputChanged: () =>void, state:ComponentFramework.Dictionary, container:HTMLDivElement)
66
+
{
67
+
this._container=container;
68
+
this._controlViewRendered=false;
69
+
}
70
+
71
+
/**
72
+
* Called when any value in the property bag has changed. This includes field values, data-sets, global values such as container height and width, offline status, control metadata values such as label, visible, etc.
73
+
* @paramcontext The entire property bag available to control via Context Object; It contains values as set up by the customizer mapped to names defined in the manifest, as well as utility functions
74
+
*/
75
+
public updateView(context:ComponentFramework.Context<IInputs>)
76
+
{
77
+
if (!this._controlViewRendered)
78
+
{
79
+
this._controlViewRendered=true;
80
+
this.renderBingMapIFrame();
81
+
}
82
+
83
+
let latitude:number=context.parameters.latitudeValue.raw!;
84
+
let longitude:number=context.parameters.longitudeValue.raw!;
85
+
this.updateBingMapURL(latitude, longitude);
86
+
}
87
+
88
+
/**
89
+
* Render IFrame HTML Element that hosts the Bing Map and appends the IFrame to the control container
90
+
*/
91
+
private renderBingMapIFrame():void
92
+
{
93
+
this._bingMapIFrame=this.createIFrameElement();
94
+
this._container.appendChild(this._bingMapIFrame);
95
+
}
96
+
97
+
/**
98
+
* Updates the URL of the Bing Map IFrame to display the updated lat/long coordinates
99
+
* @paramlatitude : latitude of center point of Bing map
100
+
* @paramlongitude : longitude of center point of Bing map
0 commit comments