Pop-Up
- Last UpdatedJun 25, 2024
- 2 minute read
Use scripts to set and get values for the properties of the Pop-Up 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; |
|
Tooltip |
No |
Not Applicable |
|
Button Text |
Yes Writable Readable |
To set the property control.findById("ID").buttonText = "Value for Button Text"; To get the value of the property control.findById("ID").buttonText; |
|
Persist Form Definition |
No |
Not Applicable |
|
Form Details |
No |
Not Applicable |
Appearance
|
Property |
Scripting Supported |
Script |
|---|---|---|
|
Enable |
Yes Writable Readable |
To set the property control.findById("ID").enable = true; To get the value of the property control.findById("ID").enable; |
|
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 |
|
Dimension |
No |
Not Applicable |
|
Retain Space |
No |
Not Applicable |
|
Show as Link |
No |
Not Applicable |
|
Custom Style Sheet Identifier |
No |
Not Applicable |
Advanced
|
Property |
Scripting Supported |
Example |
|---|---|---|
|
On Data Change |
Yes |
For more information, see scripting guidelines for On Data Change property. |
|
ID |
No |
Not Applicable |
|
Open New Window |
No |
Not Applicable |
|
Persist Value |
No |
Not Applicable |
|
Form Button |
No |
Not Applicable |
Scripts
|
Property |
Scripting Supported |
Example |
|---|---|---|
|
Name |
Yes |
return "Value for Name"; |
|
Description |
Yes |
return "Value for Description"; |
|
Enable |
Yes |
return true; For more information, see scripting guidelines for Enable property. |
|
Visible |
Yes |
return true; For more information, see scripting guidelines for Visible property. |
|
Validate |
Yes |
return new ValidationOptions(false, "Error Message"); OR return new ValidationOptions(true, ""); For more information, see scripting guidelines for Validate property. |
Example
If you want to populate the value of the Name (T1) control in the Pop-Up form with the value of the Last Name (T2) control in the parent form, then you can code the script for the Value property of the Name (T1) control as follows:
if(!SFU.isUndefined(window.parentViewModel))
{
return window.parentViewModel.topLevelForm.findById("T2").value;
}
If you want to populate the value of the Project (T3) control in the parent form with the value of the Assigned Project (T2) control in the Pop-Up form, then you can code the script for the On Data Change event of the Details (P1) control as follows:
if(!SFU.isUndefined(control.extendedInformation))
{
control.findById("T3").value = control.extendedInformation["Textinput2"];
}
If, Assigned Project (T2) control in the Pop-Up form is inside a container Project Details (B1), then you can code the script for the On Data Change event of the Details (P1) control as follows:
if(!SFU.isUndefined(control.extendedInformation))
{
control.findById("T3").value = control.extendedInformation["B1"]["T2"];
}