CRecordWebNotifyTableRowClicked
The CRecordWebNotifyTableRowClicked message is a notification for a click on a table row.
To receive this message,
- a listener must be installed for the table: CRecordWebAddTableRowListener
- your target address must be linked to the element ID: CRecordWebRegisterWidgetOwner
The message is part of the RemoteSkin Web API.
The API is located in the plugin NY_RemoteSkinWebProtocolAPI.
{
"id": "cc1224b7-86e7-4467-8b7c-6647e24e3021",
"name": "WEB_NOTIFY_TABLE_ROW_CLICKED",
"description": "Notification: A table row has been clicked.",
"slots": [
{
"key": "1",
"name": "ID",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "STRING",
"description": "The ID of the table."
},
{
"key": "2",
"name": "DATA",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "STRING_ARRAY",
"description": "The data of the table row (column 0-n)."
}
]
}
Arguments
- ID : The ID of the table element to which the message belongs.
- DATA : The data of the table row, from column 0-n.
Usage
Register your target address for this ID. You need to have the RemoteSkin address.
final CWebApi webApi = new CWebApi(this, // your target
mRemoteSkinAddress);
webApi.registerWidgets(new String[]{"myElementId"});
Register a listener for an element ID.
webApi.addTableRowListener("myElementId");
Register a message handler for this message.
// constructor:
addMessageHandler(CRecordWebNotifyTableRowClicked.ID,
this::asyncNotifyTableRowClicked);
Implement the message handler.
private boolean asyncNotifyTableRowClicked(@NotNull final CEnvelope aEnvelope,
@NotNull final CRecord aRecord) throws CException
{
if (aEnvelope.isAnswer())
{
return false;
}
else
{
final String id = CRecordWebNotifyTableRowClicked.getId(aRecord,
"");
final String[] data = CRecordWebNotifyTableRowClicked.getData(aRecord,
null);
// ...
aEnvelope.setResultSuccess();
return true;
}
}