CRecordWebAlert

The message CRecordWebAlert displays the Javascript message box.

The message is part of the RemoteSkin Web API.
The API is located in the plugin NY_RemoteSkinWebProtocolAPI.

{
  "id": "a1b4984f-7582-45ce-a292-d7e86732f4f8",
  "name": "WEB_ALERT",
  "description": "Show a message.",
  "slots": [
    {
      "key": "1",
      "name": "MESSAGE",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING",
      "description": "The message to show."
    }
  ]
}

Arguments

  • MESSAGE : The message to display.

Usage with the helper class CWebApi

The easiest way is to call the corresponding method in the CWebApi class. The use of the class is described there.

mWebApi.alert("Hello!");

Usage as message

The RemoteSkin target address is also required.

public void alert(@NotNull final CTargetAddress aRemoteSkinAddress,
                  @NotNull final String aMessage) throws CException
{
    // Envelope
    final CEnvelope env = CEnvelope.forSingleTarget(mRemoteSkinAddress);
    
    // Record
    final CRecord record = CRecordWebAlert.create();
    CRecordWebAlert.setMessage(record,
                               aMessage);
    
    // send message
    sendNotification(env,
                     record);
}

See also: