I have an XForm document in LibreOffice Writer 5. The form contains various text boxes and date fields. What I want is to create a Javascript macro that will be assigned to one text box and perform some actions whenever the user changes the input of this field. So far I have written the following
var oDoc = UnoRuntime.queryInterface(XModel, XSCRIPTCONTEXT.getInvocationContext());
if (!oDoc) {
oDoc = XSCRIPTCONTEXT.getDocument();
}
var xFieldsSupplier = UnoRuntime.queryInterface(XFormsSupplier, oDoc);
var xForm = xFieldsSupplier.getXForms();
but xForm is null. Does anyone know how I can get the XForm fields? Is there something wrong with the above code?