<?xml-stylesheet type="text/xsl" href="/xforms-tests/xsltforms/xsltforms.xsl"?>
<html xmlns:my="http://commerce.example.com/payment" xmlns:txs="http://sourceforge.net/projects/txs" xmlns="http://www.w3.org/1999/xhtml" xmlns:req="http://www.agencexml.com/requests" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:et="http://w3c.org/eventtracker">

<head>
	<title>10.6.a events dispatched by toggle element</title>
	<link rel="stylesheet" href="../../driverPages/forms/TestSuite11.css" type="text/css"/>
	<xforms:model>
		<xforms:instance xmlns="">
			<yourname/>
		</xforms:instance>
	</xforms:model>
</head>
<body>
	<xforms:group>
		<xforms:label class="title">10.6.a events dispatched by toggle element</xforms:label>
	</xforms:group>
	<xforms:group>
		<xforms:label>
				If you are in the "in" case and you activate the Show Out Case trigger
				you must see an xforms-deselect(in) message followed by an 
				xforms-select(out) message. 
				If you are in the "out" case and you activate the Show In Case trigger
				you must see an xforms-deselect(out) message followed by an 
				xforms-select(in) message. 
		</xforms:label>
	</xforms:group>
	<xforms:switch>
		<xforms:case id="in">
			<xforms:group>
				<xforms:label>You are now in the "in" case</xforms:label>
			</xforms:group>
			<xforms:trigger ref="/yourname">
				<xforms:label>Show Out Case</xforms:label>
				<xforms:toggle ev:event="DOMActivate" case="out"/>
			</xforms:trigger>
			<xforms:group>
				<xforms:action ev:event="xforms-select" ev:observer="in">
					<xforms:message level="modal">xforms-select(in)</xforms:message>
				</xforms:action>
			</xforms:group>
			<xforms:group>
				<xforms:action ev:event="xforms-deselect" ev:observer="in">
        			<xforms:message level="modal">xforms-deselect(in)</xforms:message>
				</xforms:action>
			</xforms:group>
		</xforms:case>
		<xforms:case id="out">
			<xforms:group>
				<xforms:label>You are now in the "out" case</xforms:label>
			</xforms:group>
			<xforms:trigger>
				<xforms:label>Show In Case</xforms:label>
				<xforms:toggle ev:event="DOMActivate" case="in"/>
			</xforms:trigger>
			<xforms:group>
				<xforms:action ev:event="xforms-select" ev:observer="out">
					<xforms:message level="modal">xforms-select(out)</xforms:message>
				</xforms:action>
			</xforms:group>
			<xforms:group>
				<xforms:action ev:event="xforms-deselect" ev:observer="out">
					<xforms:message level="modal">xforms-deselect(out)</xforms:message>
				</xforms:action>
			</xforms:group>
		</xforms:case>
	</xforms:switch>

</body>
</html>
