The actions, properties and events (APE) architecture allows you to define simple interactions between widgets on an XDIME 2 page, without the need to use JavaScript methods. However, JavaScript remains fully supported, and may be required for more complex applications.
The actions, properties and events (APE) architecture allows you to define simple interactions between widgets on an XDIME 2 page, without the need to use JavaScript methods. However, JavaScript remains fully supported, and may be required for more complex applications.
An action can be executed at any moment in time. It may have two states.
disabled - invoking an action does nothing
enabled - invoking an action performs it
A property contains a value, which may change over time. Each property has the following settings.
readable - value of the selected property can be read
writable - value of the property can be written
All the actions support the is-enabled property, which specifies their state.
An event is information, which can be sent by a widget at any time. The event can cause the widget:handler element to invoke certain actions when a specified event occurs.
Each property supports the value-changed event, sent when its value changes.
All the actions, properties and events are also exposed to the XDIME author in the form of the JavaScript API. The following naming conventions apply:
Each action has a JavaScript method with a corresponding name, for example, for the next-page action, the nextPage() JavaScript method exists.
In general, each readable property has a JavaScript method with the get prefix, for example, the getCurrentPageNumber() method corresponds to the current-page-number property. But there are some exceptions. If the name of the property starts with is-, can-, has- or does-, the get prefix in a JavaScript method is omitted, for example, the is-enabled property corresponds to the isEnabled() JavaScript method.
For each writable property there is usually a corresponding JavaScript method with the set prefix, for example, the setCurrentPageNumber(number) method corresponds to the current-page-number property. However, if the name of the property starts with is-, can-, has- or does-, then its prefix in a JavaScript method is omitted, for example, the is-enabled property corresponds to the setEnabled() JavaScript method.
JavaScript method | Description |
---|---|
observe(widget, notificationName, methodName) | Starts observing selected widget for a specified notification. The defined method will be invoked when the notification is sent. |
stopObserving(widget, notificationName, methodName) | Stops observing selected widget for the specified notification |
In the following example the widget:button element is used to launch the Forms Wizard widget with the id attribute set to 'myWizard'.
<widget:button id="start-button" class="button" action="myWizard#launch">
Start the wizard
</widget:button>