Skip to content

Instantly share code, notes, and snippets.

@avernet
Created May 29, 2015 02:07
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/8791e4c549f8bc2a50d2 to your computer and use it in GitHub Desktop.
Save avernet/8791e4c549f8bc2a50d2 to your computer and use it in GitHub Desktop.
Simple autocomplete
<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>
<country/>
</xf:instance>
</xf:model>
</xh:head>
<xh:body>
<fr:autocomplete ref="." labelref="country-name/@label"
resource="/fr/service/custom/orbeon/controls/countries?country-name={$fr-search-value}"
max-results-displayed="4">
<xf:label>Country code: </xf:label>
<xf:itemset nodeset="/countries/country">
<xf:label ref="name"/>
<xf:value ref="us-code"/>
</xf:itemset>
</fr:autocomplete>
</xh:body>
</xh:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment