Export

The Confirmation Box UI is an alternative to the old-fashioned browsers confirm boxes. It displays a nice popup box asking the user to confirm an action. Functions hooks are available on both confirm and cancel actions.

Usage

new XWiki.widgets.ConfirmationBox(behavior, interactionParameters);

behavior

Object that define confirm and cancel handlers. When the user chooses "Yes", its "onYes" method is triggered if it exists. When the user chooses "No", its "onNo" method is triggered, if it exists. When the user chooses "Cancel", if the cancel button is enabled, its "onCancel" method is triggered, if it exists. The behavior parameter is not mandatory and is empty by default (It means nothing will happen upon confirmation or cancel).

Object that defines the different text elements displayed within the confirmation box. Five variables are available for customization: confirmationText - the message to confirm (default value for the English language is Are you sure ?), yesButtonText - the "yes" button text (or confirm button), noButtonText - the "no" button text, cancelButtonText - the "cancel" button text, if enabled, and showCancelButton - whether to show the cancel button, disabled by default.