setXML
Dynamically generates UI components through ogscript. Replaces the contents of an element with a string of XML code.
Syntax
ogscript.setXML (ID, new XML content)
Parameters
Parameter |
Type |
Required |
Description |
ID |
String |
Yes |
ID for the component in which you want to replace XML |
new XML content |
String |
Yes |
The new XML content |
Returns
N/A
Example
This example includes a label with text. When the user clicks the label, the associated task uses ogscript.setXml to replace the text.
<abs id="0x4">
<label height="59" id="0x2" left="61" name="This Text Will Be Replaced" style="txt-align:center" top="40" width="238"/>
</abs>
<buttonbuttontype="push" height="40" id="0x3" left="59" name="replaceText" top="121" width="240">
<task tasktype="ogscript">ogscript.setXml('0x4', '<label height="59" id="0x2" left="61" name="This is the New Text" style="txt-align:center" top="40" width="238"/>');
</task>
</button>