Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Centralized client logic:

Most ui components allow users to run custom logic on certain events. (ex. on initialize, on value change, on before save, ...)
These customizable events are available directly from the repository, as attributes.
The attributes support simple JavaScript syntax:

...

  • self (deprecated) - the underlying dynObj of the triggering object
  • oSelf (deprecated) - the underlying controller of the triggering object
  • eventSource - the object on which the event is triggered
  • eventOrigin - the container from where the current screen was launched

Decentralized client logic: (SWAT 22.13.0+)

As of SWAT 22.13.0, support for decentralized client logic has been introduced.
As seen in the example above, the functions need to be available in the global context to be able to reference them.
This means having to maintain that global context to avoid conflicts and having to reference the events by their full path.
Moreover, this also means that all the client logic is loaded in the main bundle.

...