CRecordWebListenOnClick1

The message CRecordWebListenOnClick1 adds a click listener to an HTML element.
If the element is clicked, the elements of the ID array provided are searched for and their values are returned using the CRecordWebNotifyClick1 message.

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

{
  "id": "85b88b65-17ca-4195-b991-8e6ad1693a09",
  "name": "WEB_LISTEN_ON_CLICK1",
  "description": "Listen for onClick and fetch widget values.",
  "slots": [
    {
      "key": "1",
      "name": "ID",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING",
      "description": "The widget ID to listen for."
    },
    {
      "key": "2",
      "name": "WIDGET_IDS",
      "direction": "REQUEST",
      "mandatory": "true",
      "type": "STRING_ARRAY",
      "description": "The IDs of widgets from which we wand the current value."
    }
  ]
}

Arguments

  • ID : The ID of the HTML element that receives a click listener.
  • WIDGET_IDS: The IDs of the HTML elements that are searched for after a click and whose values are returned.

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.addClickListener1(@NotNull final String aId,
                          @NotNull final String[] aWidgetIds);

Usage as message

The RemoteSkin target address is also required.

public void addClickListener1(@NotNull final CTargetAddress aRemoteSkinAddress,
                              @NotNull final String aId,
                              @NotNull final String[] aWidgetIds) throws CException
{
    // Envelope
    final CEnvelope env = CEnvelope.forSingleTarget(mRemoteSkinAddress);
    
    // Record
    final CRecord record = CRecordWebListenOnClick1.create();
    CRecordWebListenOnClick1.setId(record,
                               aId);
    CRecordWebListenOnClick1.setWidgetIds(record,
                               aWidgetIds);
    
    // send message
    sendNotification(env,
                     record);
}

See also: