Defines an optional parameter value passed into the handler's JavaScript method.
Please note that parameters without a value must be specified after all parameters with values.
Attribute | Description | Type | Default | Options | Use |
---|---|---|---|---|---|
name | The name of the parameter, as used in the body of the script. | xs:string | required | ||
type | The type of the value of the parameter. This attribute can only be used when a cf2:param element is enclosed by a cf2:data-source element, and must be specified if the parameter value is not specified with one of the fixed attributes. | xs:string | boolean, number, string | optional |
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
xmlns:mcs="http://www.volantis.com/xmlns/2006/01/xdime/mcs"
xmlns:cf2="http://www.volantis.com/xmlns/2009/07/cf2"
xmlns:ui="http://www.volantis.com/xmlns/2009/07/cf2/ui">
<head>
<title>cf2:on</title>
</head>
<body>
<div>
<a id="mylink"/>
<ui:box id="fi-summary">
<ui:button>
<span style="float: left">Click me!</span>
<ui:inline id="fi-plus" initial-displayed-state="true"/>
<ui:inline id="fi-minus" initial-displayed-state="false"/>
<cf2:on event="cf2:activate">
<cf2:param name="disp" property="fi-details#displayed"/>
<cf2:param name="dispM" property="fi-minus#displayed"/>
<cf2:param name="dispP" property="fi-plus#displayed"/>
if(!disp.get()) {
disp.set(true);
dispM.set(true);
dispP.set(false);
window.location.href='#mylink';
} else {
disp.set(false);
dispM.set(false);
dispP.set(true);
}
</cf2:on>
</ui:button>
<div style="clear: both"/>
</ui:box>
<ui:box id="fi-details" initial-displayed-state="false">
<p>Item 1</p>
<p>Item 2</p>
<p>Item 3</p>
</ui:box>
</div>
</body>
</html>