CRecordWebAddFirstChild: Insert a Child Element at the Beginning of an HTML Element
since version 2.5
The message
The message is part of the
The API is located in the plugin NY_
{ "id": "c8123725-6e09-4a8b-a03f-71d5eb13effb", "name": "WEB_ADD_FIRST_CHILD ", "description": "Add an element as first child.", "slots": [ { "key": "1", "name": "ID ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The id of the reference element." }, { "key": "2", "name": "HTML ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The html of the element to insert." } ] }
Arguments
-
ID : The ID of the HTML element to which a child element is to be added. -
HTML : The HTML of the child element to be added.
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.addFirstChild("id_of_my_list" ,"<li>Banana</li>" );
Usage as a Message
The
public voidaddFirstChild (@NotNull final CTargetAddressa , @NotNull final StringRemote Skin AddressaIdOfParentElement , @NotNull final StringaChildElement ) throws CException {// Envelope final CEnvelope env = CEnvelope.forSingleTarget(m );Remote Skin Address// Record final CRecord record =CRecordWebAddFirstChild .create();CRecordWebAddFirstChild .setId(record,aIdOfParentElement );CRecordWebAddFirstChild .setHtml(record,aChildElement );// send message sendNotification(env, record); }