Skip to content

Instantly share code, notes, and snippets.

@avernet
Created February 4, 2016 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avernet/5235e158927cfad6e2ae to your computer and use it in GitHub Desktop.
Save avernet/5235e158927cfad6e2ae to your computer and use it in GitHub Desktop.
Using xxforms-value-changed with a test on the node changed
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
<xh:head>
<xf:model>
<xf:instance id="my-instance">
<instance>
<a/>
<b/>
</instance>
</xf:instance>
<xf:message event="xxforms-value-changed"
observer="my-instance"
if="event('node') = instance()/a"
value="'Changed'"/>
</xf:model>
</xh:head>
<xh:body>
<xf:trigger>
<xf:label>Set value</xf:label>
<xf:setvalue event="DOMActivate" ref="a">42</xf:setvalue>
</xf:trigger>
</xh:body>
</xh:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment