CRecordWebSetInnerHtml
The CRecordWebSetInnerHtml message sets the HTML content (inner HTML) of an element.
The message is part of the RemoteSkin Web API.
The API is located in the plugin NY_RemoteSkinWebProtocolAPI.
{
"id": "a6af1ae5-d752-45e7-9dc9-d048d6f14f80",
"name": "WEB_SET_INNER_HTML",
"description": "Insert a HTML text.",
"slots": [
{
"key": "1",
"name": "ID",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "STRING",
"description": "The widget ID."
},
{
"key": "2",
"name": "HTML",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "STRING",
"description": "The HTML to insert."
}
]
}
Arguments
- ID : The ID of the HTML element.
- HTML : The new content of the HTML element.
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.setInnerHtml(@NotNull final String aId,
@NotNull final String aHtml);
Usage as message
The RemoteSkin target address is also required.
public void setInnerHtml(@NotNull final CTargetAddress aRemoteSkinAddress,
@NotNull final String aId,
@NotNull final String aHtml) throws CException
{
// Envelope
final CEnvelope env = CEnvelope.forSingleTarget(mRemoteSkinAddress);
// Record
final CRecord record = CRecordWebSetInnerHtml.create();
CRecordWebSetInnerHtml.setId(record,
aId);
CRecordWebSetInnerHtml.setHtml(record,
aHtml);
// send message
sendNotification(env,
record);
}