Provides a method for dismissing a widget.
Multiple instances may be present within a widget:date-picker or widget:popup element; one for each dismiss action.
If a widget:dismiss element is not provided then it is assumed that the widget will be hidden by some external trigger.
Attribute | Description | Type | Default | Options | Use |
---|---|---|---|---|---|
type | Type of a dismiss button. | xs:string | optional |
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xmlns:widget="http://www.volantis.com/xmlns/2006/05/widget">
<head>
<title>widget:button</title>
</head>
<body>
<div>
<widget:button action="myPopup#show">click me!</widget:button>
</div>
<widget:popup id="myPopup">
<div>Hello!</div>
<widget:dismiss>X</widget:dismiss>
</widget:popup>
</body>
</html>
You use the JavaScript property arguments to retrieve the value of the type attribute.
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xmlns:event="http://www.w3.org/2001/xml-events"
xmlns:mcs="http://www.volantis.com/xmlns/2006/01/xdime/mcs"
xmlns:widget="http://www.volantis.com/xmlns/2006/05/widget">
<head>
<title>widget:dismiss</title>
<widget:handler event="myPopup#dismissed" action="scriptOnDismiss#invoke"/>
<widget:script id="scriptOnDismiss">alert("The dismiss button of type '" + arguments[0] + "' was used.")</widget:script>
</head>
<body>
<widget:popup id="myPopup" style="top:10%; left:20%">
<p>Hello world!</p>
<widget:dismiss>Dismiss type=null</widget:dismiss>
<widget:dismiss type="YES">Dismiss type=YES</widget:dismiss>
<widget:dismiss type="NO">Dismiss type=NO</widget:dismiss>
</widget:popup>
<div>
<a href="javascript:Widget.getInstance('myPopup').show()">show popup</a>
</div>
</body>
</html>