Created
January 26, 2012 23:50
-
-
Save avernet/1685914 to your computer and use it in GitHub Desktop.
Copy a section to all the other sections in XForms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xhtml:html xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> | |
<xhtml:head> | |
<xforms:model> | |
<xforms:instance> | |
<instance> | |
<rep-section> | |
<first-name/> | |
<last-name/> | |
</rep-section> | |
<rep-section> | |
<first-name/> | |
<last-name/> | |
</rep-section> | |
<rep-section> | |
<first-name/> | |
<last-name/> | |
</rep-section> | |
</instance> | |
</xforms:instance> | |
</xforms:model> | |
</xhtml:head> | |
<xhtml:body> | |
<xforms:repeat ref="rep-section"> | |
<xhtml:div> | |
<xforms:input ref="first-name"> | |
<xforms:label>First name: </xforms:label> | |
</xforms:input> | |
<xforms:input ref="last-name"> | |
<xforms:label>Last name: </xforms:label> | |
</xforms:input> | |
<xforms:trigger> | |
<xforms:label>Copy to other section</xforms:label> | |
<xforms:action ev:event="DOMActivate"> | |
<xxforms:variable name="source" select="."/> | |
<xforms:action ev:event="DOMActivate" xxforms:iterate="../* except ."> | |
<xforms:delete ref="*"/> | |
<xforms:insert context="." origin="$source/*"/> | |
</xforms:action> | |
</xforms:action> | |
</xforms:trigger> | |
</xhtml:div> | |
</xforms:repeat> | |
</xhtml:body> | |
</xhtml:html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment