Skip to content

Instantly share code, notes, and snippets.

@avernet
avernet / form.xml
Created September 17, 2015 22:18
Reset values in autocomplete in repeat when value is selected in a selection control
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
  • Place the XBL file below the XBL under WEB-INF/resources/xbl/example/first-last/first-last.xbl.
  • Add to properties below to your properties-local.xml. The first is to include the component in Form Builder. The second is so Orbeon Forms knows about the example namespace in which we placed this XBL component. This tells the XForms engine in what directory (it takes the part after oxf.xforms.xbl.mapping. and puts it after xbl, here inferring xbl/example) it can find the component in a given namespace (here http://www.example.com/).
  • In Form Builder, click on the green Reload Toolbox icon.
<property as="xs:string"  
          name="oxf.fb.toolbox.group.custom.*.*.*" 
          value="oxf:/xbl/example/first-last/first-last.xbl"/>
<property as="xs:string"
 name="oxf.xforms.xbl.mapping.example" 
@avernet
avernet / gist:704e5f83dbf359c7e4be
Created July 13, 2015 17:59
"Dynamic" HTML in label of checkboxes
<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>
<gaga>1</gaga>
<xh:html xmlns:xf="http://www.w3.org/2002/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" xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/xhtml https://raw.github.com/orbeon/orbeon-forms/master/src/main/resources/org/orbeon/oxf/xml/schemas/xhtml1-transitional-orbeon.xsd">
<xh:head>
<xh:title>Orbeon CodeMirror Test</xh:title>
<xh:style type="text/css">
.CodeMirror { width: 100% !important; height: 100% !important; }
</xh:style>
<xf:model id="code-mirror">
<xf:instance id="xml" xxf:exclude-result-prefixes="#all">
<xml/>
</xf:instance>
@avernet
avernet / format.xhtml
Created June 19, 2015 01:12
Showing formatted XML / HTML
<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"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xh:head>
<xf:model>
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
Starting ENSIME server: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/lib/tools.jar:/Users/avernet/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.6.jar:/Users/avernet/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.6.jar:/Users/avernet/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.6.jar:/Users/avernet/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.3.jar:/Users/avernet/.ivy2/cache/org.scala-lang.modules/scala-parser-combinators_2.11/bundles/scala-parser-combinators_2.11-1.0.3.jar:/Users/avernet/.ivy2/cache/org.ensime/ensime_2.11/jars/ensime_2.11-0.9.10-SNAPSHOT.jar:/Users/avernet/.ivy2/cache/org.ensime/server_2.11/jars/server_2.11-0.9.10-SNAPSHOT.jar:/Users/avernet/.ivy2/cache/org.ensime/api_2.11/jars/api_2.11-0.9.10-SNAPSHOT.jar:/Users/avernet/.ivy2/cache/com.github.stacycurl/pimpathon-core_2.11/jars/pimpathon-core_2.11-1.4.
@avernet
avernet / gist:8791e4c549f8bc2a50d2
Created May 29, 2015 02:07
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/>
@avernet
avernet / gist:c44853b0acf27c030aa9
Created May 14, 2015 23:49
Dropdown with values from a repeat
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"
@avernet
avernet / gist:a5af3f6c1274e623db83
Created May 7, 2015 17:45
Fill first name field with value from URL
<xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:exf="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:saxon="http://saxon.sf.net/"