Embed Form
- Last UpdatedJun 25, 2024
- 2 minute read
Use scripts to set and get values for the properties of the Embed Form control.
Basic
|
Property |
Scripting Supported |
Example |
|---|---|---|
|
Name |
Yes Writable Readable |
To set the property control.findById("ID").tagName = "Value for Name"; To get the value of the property control.findById("ID").tagName; |
|
XML Node |
Yes Readable |
To get the value of the property control.findById("ID").xmlNodeBoundTo; |
|
Description |
Yes Writable Readable |
To set the property control.findById("ID").description = "Value for Description"; To get the value of the property control.findById("ID").description; |
|
Persist Form Definition |
No |
Not Applicable |
|
Form Details |
No |
Not Applicable |
Appearance
|
Property |
Scripting Supported |
Script |
|---|---|---|
|
Visible |
Yes Writable Readable |
To set the property control.findById("ID").visible = true; To get the value of the property control.findById("ID").visible; |
|
Label Position |
No |
Not Applicable |
|
Label-Control Area |
No |
Not Applicable |
|
Width |
No |
Not Applicable |
|
Height |
No |
Not Applicable |
|
Retain Space |
No |
Not Applicable |
|
Show Panel Details |
No |
Not Applicable |
|
Adapt UI |
No |
Not Applicable |
|
Custom Style Sheet Identifier |
No |
Not Applicable |
Advanced
|
Property |
Scripting Supported |
Example |
|---|---|---|
|
ID |
No |
Not Applicable |
Scripts
|
Property |
Scripting Supported |
Example |
|---|---|---|
|
Name |
Yes |
return "Value for Name"; |
|
Description |
Yes |
return "Value for Description"; |
|
Visible |
Yes |
return true; For more information, see scripting guidelines for Visible property. |
Note: Syntax Check for the scripts written for the controls inside the Embed Form control is not supported. A warning message appears in the script editor, when syntax check is performed and also whenever the scripts are saved. However, you can proceed to save the scripts.
Best Practices
-
We recommend using unique XML nodes for controls in source forms to aid in scripting.
-
We recommend using the control.findByXmlNode() method instead of the control.findById() method in source forms to avoid conflict of IDs between forms
Scenario 1 – Updating Value of T2 (Present inside Embed Form) from a control inside Embed Form
control.findByXmlNode("T2").value = "SomeValue";
Scenario 2 – Updating Value of T2 (Present Outside Embed Form) from a control inside Embed Form
Control.topLevelForm.findByXmlNode("T2").value = "SomeValue";
Scenario 3 – Updating Value of T2 (Present Inside Embed Form) from a control Outside Embed Form
control.findByXmlNode("EmbedFormXmlNode").findByXmlNode("T2").value= "SomeValue";