topical media & game development
professional-xml-23-syntax-actions.xml / xml
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ex="someURI">
<head>
<title>Actions</title>
<xf:model>
<xf:instance>
<ex:value a="8" b="13" />
</xf:instance>
</xf:model>
</head>
<body>
<p>
<xf:input ref="@a"/> + <xf:input ref="@b" id="B"/>
= <xf:output value="@a+@b" />
<p>
<xf:trigger>
<xf:label>Set A to 20</xf:label>
<xf:action ev:event="DOMActivate">
<xf:setvalue ref="@a">20</xf:setvalue>
</xf:action>
</xf:trigger>
<xf:trigger>
<xf:label>Setfocus</xf:label>
<xf:action ev:event="DOMActivate">
<xf:setfocus control="B" />
</xf:action>
</xf:trigger>
<xf:trigger>
<xf:label>Reset</xf:label>
<xf:action ev:event="DOMActivate">
<xf:reset/>
</xf:action>
</xf:trigger> </p>
</p>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.