Skip to content

Instantly share code, notes, and snippets.

@avernet
Created January 22, 2016 04:00
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/c00da27fcb3827dbdda4 to your computer and use it in GitHub Desktop.
Save avernet/c00da27fcb3827dbdda4 to your computer and use it in GitHub Desktop.
<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>
<instance>
<checked/>
</instance>
</xf:instance>
</xf:model>
</xh:head>
<xh:body>
<xf:select appearance="full" ref="checked">
<xf:item>
<xf:label>1</xf:label>
<xf:value>1</xf:value>
</xf:item>
<xf:item>
<xf:label>2</xf:label>
<xf:value>2</xf:value>
</xf:item>
<xf:item>
<xf:label>3</xf:label>
<xf:value>3</xf:value>
</xf:item>
</xf:select>
<xf:trigger>
<xf:label>Add rows</xf:label>
<xf:action event="DOMActivate" iterate="xxf:split(checked)">
<xf:var name="current" value="."/>
<xf:insert context="instance()" origin="xxf:element('row', $current)"/>
</xf:action>
</xf:trigger>
<xh:div style="margin-top: 1em">
<xf:repeat ref="row">
<xf:input ref="."/>
</xf:repeat>
</xh:div>
</xh:body>
</xh:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment