CRecordWebNotifyClick1
The
To receive this message,
- a listener must be installed for the HTML element: CRecordWebListenOnClick1
- 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": "64e979ff-d44d-4a83-bdf2-286f6b431c43", "name": "WEB_NOTIFY_CLICK1 ", "description": "A widget has been clicked.", "slots": [ { "key": "1", "name": "ID ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The widget ID." }, { "key": "2", "name": "VALUES ", "direction": "REQUEST", "mandatory": "true", "type": "STRING_PROPERTIES", "description": "The widget ids and their values." } ] }
Arguments
-
ID : The ID of the html element to which the message belongs. -
VALUES : When setting up the listener, you specified an array of element IDs whose values you want to receive upon a click. These values are provided as a property list, with the element ID as the key and the element's value as the corresponding value.
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.addClickListener1("myElementId", new String[]{"element1","element2","element3"});
Register a message handler for this message.
// constructor: addMessageHandler(CRecordWebNotifyClick1 .ID, this::asyncNotifyClick1);
Implement the message handler.
private boolean asyncNotifyClick1(@NotNull final CEnvelope aEnvelope, @NotNull final CRecord aRecord) throws CException { if (aEnvelope.isAnswer()) { return false; } else { final Stringid =CRecordWebNotifyClick1 .getId(aRecord, ""); final CStringPropertiessp =CRecordWebNotifyClick1 .getValues(aRecord, null);// ... aEnvelope.setResultSuccess(); return true; } }