Apps and development tools - Basic App Kit

Utilities

Alerts

There are three ways to show alert messages:

Client side Javascript:

<a class="btn" href="javascript:App.alert('Hello World', 'Important')">Alert</a>

Actions that fire an event:

<a class="btn" href="<tml:url type="action" ajax="norefresh">

  var event = createEvent("alert");

  event.addParameter("message", "this is<br>Important");

  event.addParameter("title", "Important");

  portlet.fireEvent(event);

</tml:url>">Alert 2</a>

Actions that use the following utility method:

<a class="btn" href="<tml:url type="action" ajax="norefresh">
AppKit.alert("Message", "Title");
</tml:url>">Alert 3</a>

In all variants the title parameter is optional. If title is undefined the DB-Title will be used as alert title.