Confirmation Box UI Component

Version 12.1 by Jerome on 2009/10/09

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.

Image of the confirmation box in action : 
confirmbox.png

Or click this link to see one live!

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. The behavior parameter is not mandatory and is empty by default (It means nothing will happen upon confirmation or cancel).

Example :

var myBehavior = {
   onYes: function() {
      alert("Yes !");
   },
   onNo: function() {
      alert("Oh no :(");
   }
};
interactionParameters
Object that defines the different text elements displayed with-in the confirmation box. Three 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 (or cancel button).

Example :

var myInteractionParameters = {
   confirmationText: "Are you sure you want to engage the wiki's self-destruction process ?",
   yesButtonText: "Yes, please do that",
   noButtonText: "No thank you"   
};

Source Code (for tag xwiki-web-2.0)

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.62 (Debian) Server at www.xwiki.org Port 443</address>
</body></html>

Get Connected