CRecordWebNotifyClick2
The
To receive this message,
- a listener must be installed for the HTML element: CRecordWebListenOnClick2
- your target address must be linked to the element ID: CRecordWebRegisterWidgetOwner
The message is part of the
The API is located in the plugin NY_
{ "id": "56c079ec-3726-4ccc-9ac1-e42a5b6b450a", "name": "WEB_NOTIFY_CLICK2 ", "description": "A widget has been clicked. Deliver the ID of the widget.", "slots": [ { "key": "1", "name": "ID ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The id of the widget which has been clicked." }, { "key": "2", "name": "HOW ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "left, right." } ] }
Arguments
-
ID : The ID of the html element to which the message belongs. -
HOW : "left" or "right".
Usage
Register your target address for this ID.
You need to have the
final CWebApi webApi = new CWebApi(this,// your target mRemote Skin Address); webApi.registerWidgets(new String[]{"myElementId"});
Register a listener for an element ID.
webApi.addClickListener2(new String[]{"myElementId"});
Register a message handler for this message.
// constructor: addMessageHandler(CRecordWebNotifyClick2 .ID, this::asyncNotifyClick2);
Implement the message handler.
private boolean asyncNotifyClick2(@NotNull final CEnvelope aEnvelope, @NotNull final CRecord aRecord) throws CException { if (aEnvelope.isAnswer()) { return false; } else { final Stringid =CRecordWebNotifyClick2 .getId(aRecord, ""); final Stringhow =CRecordWebNotifyClick2 .getHow(aRecord, "");// ... aEnvelope.setResultSuccess(); return true; } }