<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://www.w3.org/1999/xhtml"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<head>
	<title>Bank (toggle)</title>
	<style type="text/css">
	  body { font-family: sans-serif}
	  label { display: inline-block; width: 6em; margin: 0 1em; text-align: right; }
	  .h {font-weight: bold}
	</style>
	<model xmlns="http://www.w3.org/2002/xforms">
	    <instance id="default">
		<data xmlns="">
		     <number>1234</number><name/><address/>
	    	</data>
            </instance>
	    <instance id="db" src="bankdb.xml"/>
	    <submission method="get"
		action="prefill.xml"
		id="prefill" replace="instance"/>
	    <submission method="put"
		action="prefill.xml"
		id="change" replace="none"/>
	</model>
</head>
<body>
    <group xmlns="http://www.w3.org/2002/xforms">
	<switch>
	   <case id="start">
	        <input ref="number"><label>Account: </label></input>
		<submit submission="prefill">
			<label>Find</label>
			<action ev:event="DOMActivate">
				<toggle case="show"/>
			</action>
		</submit>
	   </case>
	   <case id="show">
		<output ref="number"><label>Account: </label></output><h:br/>
		<input ref="name"><label>Name </label></input><h:br/>
		<textarea ref="address"><label>Address</label>
		</textarea>
		<trigger>
			<label>Submit</label>
			<action ev:event="DOMActivate">
				<message>This example is a mock-up, so the submission hasn't actually been done</message>
				<toggle case="start"/>
				<setvalue ref="number"/>
			</action>
		</trigger>
		<trigger>
			<label>Cancel</label>
			<action ev:event="DOMActivate">
				<toggle case="start"/>
				<setvalue ref="number"/>
			</action>
		</trigger>
	   </case>
	</switch>
    </group>
</body>
</html>

