Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ebruchez
Created March 1, 2018 00:20
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 ebruchez/d79afb1490fddc06b3aabd1eee562c8c to your computer and use it in GitHub Desktop.
Save ebruchez/d79afb1490fddc06b3aabd1eee562c8c to your computer and use it in GitHub Desktop.
Simple fr:tree-select1 example
<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>
<xh:title>XForms Hello</xh:title>
<xh:script type="text/javascript" src="/apps/fr/resources/scalajs/orbeon-form-runner.js"/>
<xf:model xxf:assets.baseline.excludes="/ops/javascript/scalajs/orbeon-xforms.js">
<xf:instance>
<value xmlns=""/>
</xf:instance>
<xf:instance id="tree-items">
<items>
<choices>
<item label="Item 1" value="1">
<item label="Item 1.1" value="1.1">
<item label="Item 1.1.1" value="1.1.1">
<item label="Item 1.1.1.1" value="1.1.1.1"/>
<item label="Item 1.1.1.2" value="1.1.1.2"/>
</item>
<item label="Item 1.1.2" value="1.1.2">
<item label="Item 1.1.2.1" value="1.1.2.1"/>
<item label="Item 1.1.2.2" value="1.1.2.2"/>
</item>
</item>
<item label="Item 1.2" value="1.2">
<item label="Item 1.2.1" value="1.2.1">
<item label="Item 1.2.1.1" value="1.2.1.1"/>
<item label="Item 1.2.1.2" value="1.2.1.2"/>
</item>
</item>
</item>
<item label="Item 2" value="2">
<item label="Item 2.1" value="2.1">
<item label="Item 2.1.1" value="2.1.1">
<item label="Item 2.1.1.1" value="2.1.1.1"/>
<item label="Item 2.1.1.2" value="2.1.1.2"/>
<item label="Item 2.1.1.3" value="2.1.1.3"/>
</item>
</item>
<item label="Item 2.2" value="2.2">
<item label="Item 2.2.1" value="2.2.1"/>
<item label="Item 2.2.2" value="2.2.2"/>
</item>
</item>
</choices>
</items>
</xf:instance>
</xf:model>
</xh:head>
<xh:body>
<xf:select1 xmlns:xxbl="http://orbeon.org/oxf/xml/xbl" id="control-2-control" ref="instance()" appearance="tree xtree-plus-minus">
<xf:itemset ref="instance('tree-items')//item">
<xf:label ref="@label"/>
<xf:value ref="@value"/>
</xf:itemset>
</xf:select1>
</xh:body>
</xh:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment