<?xml version="1.0"?>
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <h:head>
    <h:title>Outreach</h:title>
    <model>
      <itext>
        <translation lang="default">
          <text id="static_instance-sites-0">
            <value>Taveta</value>
          </text>
          <text id="static_instance-sites-1">
            <value>Sio Port</value>
          </text>
          <text id="static_instance-sites-2">
            <value>Other</value>
          </text>
          <text id="static_instance-sites-3">
            <value>Busia</value>
          </text>
          <text id="static_instance-sites-4">
            <value>Malaba</value>
          </text>
          <text id="static_instance-sites-5">
            <value>Other</value>
          </text>
          <text id="static_instance-countries-0">
            <value>Kenya</value>
          </text>
          <text id="static_instance-countries-1">
            <value>Uganda</value>
          </text>
          <text id="static_instance-countries-2">
            <value>Other</value>
          </text>
        </translation>
      </itext>
      <instance>
        <outreach delimiter="#" id="outreach" prefix="J1!outreach!" version="6/9/2017">
          <country/>
          <country_other/>
          <site/>
          <site_other/>
          <meta>
            <instanceID/>
          </meta>
        </outreach>
      </instance>
      <instance id="sites">
        <root>
          <item>
            <itextId>static_instance-sites-0</itextId>
            <country>kenya</country>
            <name>taveta</name>
          </item>
          <item>
            <itextId>static_instance-sites-1</itextId>
            <country>kenya</country>
            <name>sio_port</name>
          </item>
          <item>
            <itextId>static_instance-sites-2</itextId>
            <country>kenya</country>
            <name>other</name>
          </item>
          <item>
            <itextId>static_instance-sites-3</itextId>
            <country>uganda</country>
            <name>busia</name>
          </item>
          <item>
            <itextId>static_instance-sites-4</itextId>
            <country>uganda</country>
            <name>malaba</name>
          </item>
          <item>
            <itextId>static_instance-sites-5</itextId>
            <country>uganda</country>
            <name>other</name>
          </item>
        </root>
      </instance>
      <instance id="countries">
        <root>
          <item>
            <itextId>static_instance-countries-0</itextId>
            <name>kenya</name>
          </item>
          <item>
            <itextId>static_instance-countries-1</itextId>
            <name>uganda</name>
          </item>
          <item>
            <itextId>static_instance-countries-2</itextId>
            <name>other</name>
          </item>
        </root>
      </instance>
      <bind nodeset="/outreach/country" required="true()" type="select1"/>
      <bind nodeset="/outreach/country_other" relevant="selected( /outreach/country , 'other')" type="string"/>
      <bind nodeset="/outreach/site" required="true()" type="select1"/>
      <bind nodeset="/outreach/site_other" relevant="selected( /outreach/site , 'other')" type="string"/>
      <bind calculate="concat('uuid:', uuid())" nodeset="/outreach/meta/instanceID" readonly="true()" type="string"/>
    </model>
  </h:head>
  <h:body class="pages">
    <select1 appearance="minimal" ref="/outreach/country">
      <label>Country</label>
      <item>
        <label>Kenya</label>
        <value>kenya</value>
      </item>
      <item>
        <label>Uganda</label>
        <value>uganda</value>
      </item>
      <item>
        <label>Other</label>
        <value>other</value>
      </item>
    </select1>
    <input ref="/outreach/country_other">
      <label>Specify other</label>
    </input>
    <select1 appearance="minimal" ref="/outreach/site">
      <label>Site</label>
      <itemset nodeset="instance('sites')/root/item[country =  /outreach/country ]">
        <value ref="name"/>
        <label ref="jr:itext(itextId)"/>
      </itemset>
    </select1>
    <input ref="/outreach/site_other">
      <label>Specify other</label>
    </input>
  </h:body>
</h:html>
