CRecordWebSetValue
The CRecordWebSetValue message sets the value of an input element.
The message is part of the RemoteSkin Web API.
The API is located in the plugin NY_RemoteSkinWebProtocolAPI.
{
"id": "a13e429c-b6bd-4566-95b4-b803ada225cb",
"name": "WEB_SET_VALUE",
"description": "Set a value of an input element.",
"slots": [
{
"key": "1",
"name": "ID",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "STRING",
"description": "The id of the element."
},
{
"key": "2",
"name": "VALUE",
"direction": "REQUEST",
"presenceConstraint": "MANDATORY",
"type": "STRING",
"description": "The value to set."
}
]
}
Arguments
- ID : The id of the HTML element.
- VALUE : The value to set.
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.setValue(@NotNull final String aId,
@NotNull final String aValue);
Usage as message
The RemoteSkin target address is also required.
public void setValue(@NotNull final CTargetAddress aRemoteSkinAddress,
@NotNull final String aId,
@NotNull final String aValue) throws CException
{
// Envelope
final CEnvelope env = CEnvelope.forSingleTarget(mRemoteSkinAddress);
// Record
final CRecord record = CRecordWebSetValue.create();
CRecordWebSetValue.setId(record,
aId);
CRecordWebSetValue.setValue(record,
aValue);
// send message
sendNotification(env,
record);
}