Skip to content

Instantly share code, notes, and snippets.

@wpride
Last active October 7, 2015 16:07
Show Gist options
  • Save wpride/6908f76c1cad7910209f to your computer and use it in GitHub Desktop.
Save wpride/6908f76c1cad7910209f to your computer and use it in GitHub Desktop.
<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:orx="http://openrosa.org/jr/xforms" xmlns="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa" xmlns:vellum="http://commcarehq.org/xforms/vellum">
<h:head>
<h:title>Basic Form</h:title>
<model>
<instance>
<data xmlns:jrm="http://dev.commcarehq.org/jr/xforms" xmlns="http://openrosa.org/formdesigner/02FD4762-52FB-404C-9AF1-5F67894D1521" uiVersion="1" version="549" name="Basic Form">
<q_name/>
<meta xmlns:cc="http://commcarehq.org/xforms"><deviceID/><timeStart/><timeEnd/><username/><userID/><instanceID/><appVersion/><location/></meta></data>
</instance>
<instance id="commcaresession">
<session>
<context>
<deviceid>cloudcare</deviceid> <!-- The unique ID for the entering device -->
<username>test</username> <!-- The username of the user entering data -->
<userid>b4d749f45c31cb0a4885db2baa3c508b</userid> <!-- The GUID of the user entering data -->
<appversion>2.0</appversion> <!-- The identifier for the software application version performing form entry-->
</context>
</session>
</instance>
<bind nodeset="/data/q_name" type="xsd:string" required="true()"/>
<itext>
<translation lang="en" default="">
<text id="q_name-label">
<value><output value="/data/meta/username"/>Enter a name:</value>
</text>
</translation>
<translation lang="hin">
<text id="q_name-label">
<value>HIN: Enter a name:</value>
</text>
</translation>
</itext>
<setvalue event="xforms-ready" ref="/data/meta/deviceID" value="instance/[@id='commcaresession']session/context/deviceid"/>
<setvalue event="xforms-ready" ref="/data/meta/timeStart" value="now()"/>
<bind nodeset="/data/meta/timeStart" type="xsd:dateTime"/>
<setvalue event="xforms-revalidate" ref="/data/meta/timeEnd" value="now()"/>
<bind nodeset="/data/meta/timeEnd" type="xsd:dateTime"/>
<setvalue event="xforms-ready" ref="/data/meta/username" value="instance/[@id='commcaresession']session/context/username"/>
<setvalue event="xforms-ready" ref="/data/meta/userID" value="instance/[@id='commcaresession']session/context/userid"/>
<setvalue event="xforms-ready" ref="/data/meta/instanceID" value="uuid()"/>
<setvalue event="xforms-ready" ref="/data/meta/appVersion" value="instance/[@id='commcaresession']session/context/appversion"/>
<bind nodeset="/data/meta/location" type="geopoint"/></model>
</h:head>
<h:body>
<input ref="/data/q_name">
<label ref="jr:itext('q_name-label')"/>
</input>
</h:body>
</h:html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment