Initialize Event Hook

   MaestroThe UI design product.  |   Form Builder |  24.04 This feature was introduced in 24.04

Maestro provides the Initialize Event Hook component (widget), which allows you to add a one-off create event that runs the On Create rule when the object is created. Depending on where you drop this component on the form, the rule may run more than once. For example, if you place this component:

  • Outside the page controller, then the rule will run once when the form starts and will only run again once a modal page that is shown is closed.
  • On a navigation page, then the rule will run each time the page is shown.
  • Inside a block that has a visibility rule on it, then it will run each time the block is made visible after it has been hidden.

This component is an appropriate place to put any override scripts that use jQuery to implement various custom behaviors on an HTML element. Page load is not always accurate for jQuery scripts if the field is inside nested visibility rules as it has to assess the rule before it starts adding the child elements. This is a field that can be added inside the block with visibility so you can run this on a widget. Each time it is hidden or shown, it will get destroyed and recreated so you need the rule to trigger accurately and this helps with not needing additional flags in visibility rules.

The component is of the data-initialize-event-hook type.

Usage

  1. Open the Palette pane in the Maestro editor.
  2. Locate the Initialize Event Hook component within the Tools folder.
  3. Drag the component into the View pane or the Wireframe.
  4. Configure the component's rule via the Properties pane.

Properties

The following properties are available to the Initialize Event Hook component:

Rules

On Create
onCreate
Provide an action script to run once this object is created, for example:
alert("On create rule on " + item.id)

Next, learn about the Autotab Controller component.