Anywhere API Reference – UserInterface

Main page of the Anywhere API Reference

Utility methods to interact with the user interface, hide/show views and dialogs, display messages to the users, etc.

show(id, …)

Shows a view or dialog based on id.

If the ID is invalid no action will be taken. View will always be stored in history automatically.

Examples

eventContext.ui.show('WorkExecution.PlannedActualList');

hideCurrentDialog

Hides the last dialog displayed.

getCurrentView()

Returns a reference to the currently displayed view.

hideCurrentView(cleanup)

Hides the currently displayed view.

Parameters

  • cleanup –

returnToView(view)

Returns back to a previous view in the history.

showMessage(message, [callback])

Displays a message box.

Examples

eventContext.ui.showMessage("This is an error!");
var msg = MessageService.createStaticMessage('gpsUnavailable').getMessage();
eventContext.ui.showMessage(msg);
ModelService.save(attachmentInfoSet).then(function() {
  self.ui.show("Platform.AttachmentInfoView");
}).otherwise(function(error) {
  self.ui.showMessage(error.message);
});

showToastMessage(msg)

Displays a ‘toast’ message.

A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive.

Examples

var msg = MessageService.createStaticMessage('Your password has been changed.').getMessage();
eventContext.ui.showToastMessage(msg);
Scroll to top