CRecordWebRemoveStyleSheet
The CRecordWebRemoveStyleSheet message removes a stylesheet.
The message is part of the RemoteSkin Web API.
The API is located in the plugin NY_RemoteSkinWebProtocolAPI.
{
"id": "55bc8f47-c012-4dbb-97e1-62f13a694cf0",
"name": "WEB_REMOVE_STYLE_SHEET",
"description": "Remove a stylesheet.",
"slots": [
{
"key": "1",
"name": "ID",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "STRING",
"description": "The style sheet ID."
}
]
}
Arguments
- ID : The ID of the style sheet element. Style sheet elements dynamically added to an HTML page should always have a unique ID to allow their removal later. Additionally, it’s important to consider that other microservices may also embed their style sheet elements dynamically. Therefore, the ID must be truly unique.
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.removeCss(@NotNull final String aId);
Usage as message
The RemoteSkin target address is also required.
public void removeCss(@NotNull final CTargetAddress aRemoteSkinAddress,
@NotNull final String aId) throws CException
{
// Envelope
final CEnvelope env = CEnvelope.forSingleTarget(mRemoteSkinAddress);
// Record
final CRecord record = CRecordWebRemoveStyleSheet.create();
CRecordWebRemoveStyleSheet.setId(record,
aId);
// send message
sendNotification(env,
record);
}