MaestroThe UI design product. | Form Builder
Maestro allows you to include and load external JavaScript libraries in a form using one of the following:
app.js
file.The last two approaches are commonly used, so Let's look at each of them in more detail.
Although page tracking is designed to add a JavaScript to a form to track it in a web analytics service, you can also use it to add custom JavaScript and HTML content to the application.
To add a library to a Maestro form:
<script type="text/javascript" async src="https://my-domain.com/resources/js/my-lib.js"></script>
.However, some JavaScript libraries can't be loaded this way.
Use the async
attribute to run the script asynchronously, which, in turn, allows the form to load and render faster.
One benefit of loading JavaScript libraries with jQueryjQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animations, and Ajax. is that the developer has complete control over when the library is loaded. This is important when you want to load a library only when it is required, which decreases the size of the application form footprint.
Another benefit of using this approach is that the path and names of the JavaScript libraries is environment-specific, so you can distinguish between production and non-production URLs.
To add a library to a Maestro form:
/AvokaSmartForm/Config/ExternalJSLibs
.Loading libraries with jQuery provides success and failure handlers. A success handler can be used to invoke a function in the loaded script. Failure can be used to notify the user.
/AvokaSmartForm/Config/ExternalJSLibs
. The code snippet is shown below:
import com.avoka.core.groovy.GroovyLogger as logger
import com.avoka.component.xml.XmlDoc
import com.avoka.core.util.XmlUtils
XmlUtils.getXPathElement(schemaSeed, "/AvokaSmartForm/Config/ExternalJSLibs")
.setTextContent(serviceParameters.get('ExternalJSLibs'));
return new XmlDoc(schemaSeed)
Next, learn about library scopes.