CRecordWebShowModal
The
The message is part of the
The API is located in the plugin NY_
{ "id": "df92f998-f2ad-484c-aac5-5e714bc7996c", "name": "WEB_SHOW_MODAL ", "description": "Show a modal dialog.", "slots": [ { "key": "1", "name": "ID ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The id of the dialog." } ] }
Arguments
-
ID : The id of the dialog HTML element (usually adiv
).
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.showModal(@NotNull final StringaId );
Usage as message
The
public void showModal(@NotNull final CTargetAddressa , @NotNull final StringRemote Skin AddressaId ) throws CException {// Envelope final CEnvelope env = CEnvelope.forSingleTarget(m );Remote Skin Address// Record final CRecord record =CRecordWebShowModal .create();CRecordWebShowModal .setId(record,aId );// send message sendNotification(env, record); }
Example for a modal dialog (using UIkit)
The following dialog is the "YesNo Dialog" used by the UserManager.
The tag {message}
is replaced by the message to be displayed.
The HTML code is then inserted into the web page using setInnerHtml and
<div id="id_00001_modal" uk-modal="bg-close: false; stack: true"> <div class="uk-modal-dialog uk-modal-body"> <button class="uk-modal-close-default" type="button" uk-close></button> <div class="uk-margin"> <div id="id_00001_message" class="uk-alert-primary" uk-alert>{message} </div> </div> <p class="uk-text-right"> <button id="id_00001_no" class="uk-button uk-button-default" type="button"> no </button> <button id="id_00001_yes" class="uk-button uk-button-primary" type="button"> yes </button> </p> </div> </div>