CRecordWebRegisterWidgetOwner

The CRecordWebRegisterWidgetOwner message enables the forwarding of notifications from the browser to your microservice. Browser messages are always associated with an HTML element ID. You can register any number of element IDs with your microservice address to receive these events.

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

{
  "id": "738d3f34-a5a0-4431-a9ed-6064d39910cd",
  "name": "WEB_REGISTER_WIDGET_OWNER",
  "description": "Register a target address for a widget.",
  "slots": [
    {
      "key": "1",
      "name": "WIDGET_IDS",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING_ARRAY",
      "description": "The IDs of HTML widgets which belong to the sender."
    }
  ]
}

Usage

Registration

This method registers an array of HTML element IDs in order to receive notifications from the browser for these elements.

The RemoteSkin target address is also required.

public void registerWidgets(@NotNull final CTargetAddress aRemoteSkinAddress,
                            final String @NotNull [] aWidgetIds) throws CException
{
    final CEnvelope env = CEnvelope.forSingleTarget(aRemoteSkinAddress);

    final CRecord record = CRecordWebRegisterWidgetOwner.create();
    CRecordWebRegisterWidgetOwner.setWidgetIds(record,
                                               aWidgetIds);
    sendNotification(env,
                     record);
}

Deregistration

When your dialog is closed, you must deregister your widgets with the message CRecordWebDeregisterWidgetOwner.

See also: