Skip to content

Live

Attaches a change event handler to the specified XPath.

1
myXml.Live(callback: (e: XmlEvent) => void):void

Attaches a change event handler to the specified XPath.

1
myXml.Live(xpath: string, callback: (e: XmlEvent) => void):void

Parameters

(e: XmlEvent) => void callback
    The callback function to execute.

string xpath
    The XPath of the nodes to attach to. If not specified, the current node is selected.

Remarks

This method attaches to both existing nodes and nodes created later.

This method is only available in client-side scripts such as Form scripts.

Examples

Handle changes on rows added later

1
2
3
4
5
6
// also runs for lines that the user adds after the form is opened
$Xml.Live('Lines/Line/Quantity', function () {
    if (this.EvaluateNumber() < 0) {
        this.SetValue(0);
    }
});

See Also