Displaying default values

See below for the pasted XML:
I have now entered default values for some questions, but none of the
default values are displayed on the phone, or uploaded to Aggregate
for that matter. Is this what should happen or is there a fault in my
design?

Also the question "RefuelMileage" should only be asked if "FuelCosts"
is not equal to 0 (zero), i.e. if the default value is 0, then the
question should not appear. But this also does not happen. Its as if
the default value is simply ignored. Any help will be much
appreciated.

<?xml version="1.0" encoding="UTF-8"?>
<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsd="http://
www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa">
  <h:head>
    <h:title>Vehicle log</h:title>
    <model>
      <instance>
        <Vehicle_log id="Vehicle_log">
          <Date/>
          <OdoStart/>
          <OdoEnd/>
          <TripDistance/>
          <Driver>Jacques</Driver>
          <FuelCosts>0</FuelCosts>
          <RefuelMileage>0</RefuelMileage>
          <TollFees>0</TollFees>
          <Remarks>None</Remarks>
        </Vehicle_log>
      </instance>
      <bind id="Date" nodeset="/Vehicle_log/Date" type="xsd:date"
required="true()"/>
      <bind id="OdoStart" nodeset="/Vehicle_log/OdoStart"
type="xsd:int" required="true()"/>
      <bind id="OdoEnd" nodeset="/Vehicle_log/OdoEnd" type="xsd:int"
required="true()"/>
      <bind id="TripDistance" nodeset="/Vehicle_log/TripDistance"
type="xsd:int" calculate="/Vehicle_log/OdoEnd - /Vehicle_log/OdoStart"/

      <bind id="Driver" nodeset="/Vehicle_log/Driver"
type="xsd:string"/>
      <bind id="FuelCosts" nodeset="/Vehicle_log/FuelCosts"
type="xsd:decimal"/>
      <bind id="RefuelMileage" nodeset="/Vehicle_log/RefuelMileage"
type="xsd:int" required="true()" relevant="/Vehicle_log/FuelCosts !=
0"/>
      <bind id="TollFees" nodeset="/Vehicle_log/TollFees"
type="xsd:decimal"/>
      <bind id="Remarks" nodeset="/Vehicle_log/Remarks"
type="xsd:string"/>
      <itext>
        <translation lang="English">
          <text id="Date">
            <value>Enter date</value>
          </text>
          <text id="OdoStart">
            <value>Odometer start</value>
          </text>
          <text id="OdoEnd">
            <value>Odometer end</value>
          </text>
          <text id="TripDistance">
            <value>Trip distance</value>
          </text>
          <text id="Driver">
            <value>Driver</value>
          </text>
          <text id="Driver-hint">
            <value>If driver is not Jacques, enter new name</value>
          </text>
          <text id="FuelCosts">
            <value>Fuel costs</value>
          </text>
          <text id="RefuelMileage">
            <value>Mileage at refuel</value>
          </text>
          <text id="TollFees">
            <value>Toll fees</value>
          </text>
          <text id="Remarks">
            <value>Remarks</value>
          </text>
          <text id="Remarks-hint">
            <value>Incidents, etc.</value>
          </text>
        </translation>
      </itext>
    </model>
  </h:head>
  <h:body>
    <input bind="Date">
      <label ref="jr:itext('Date')"/>
    </input>
    <input bind="OdoStart">
      <label ref="jr:itext('OdoStart')"/>
    </input>
    <input bind="OdoEnd">
      <label ref="jr:itext('OdoEnd')"/>
    </input>
    <input bind="TripDistance">
      <label ref="jr:itext('TripDistance')"/>
    </input>
    <input bind="Driver">
      <label ref="jr:itext('Driver')"/>
      <hint ref="jr:itext('Driver-hint')"/>
    </input>
    <input bind="FuelCosts">
      <label ref="jr:itext('FuelCosts')"/>
    </input>
    <input bind="RefuelMileage">
      <label ref="jr:itext('RefuelMileage')"/>
    </input>
    <input bind="TollFees">
      <label ref="jr:itext('TollFees')"/>
    </input>
    <input bind="Remarks">
      <label ref="jr:itext('Remarks')"/>
      <hint ref="jr:itext('Remarks-hint')"/>
    </input>
  </h:body>
</h:html>

I am updating myself again.
I tested Group Complete's "GC Mobile" app by simply importing this
form from Aggregate as is, and then it display the default values on
the phone and output it as expected. Perhaps this is a bug with Kobo
Admin and not Kobo forms?

···

On Nov 8, 5:28 pm, Bergie <bergi...@gmail.com> wrote:

See below for the pasted XML:
I have now entered default values for some questions, but none of the
default values are displayed on the phone, or uploaded to Aggregate
for that matter. Is this what should happen or is there a fault in my
design?

Also the question "RefuelMileage" should only be asked if "FuelCosts"
is not equal to 0 (zero), i.e. if the default value is 0, then the
question should not appear. But this also does not happen. Its as if
the default value is simply ignored. Any help will be much
appreciated.

<?xml version="1.0" encoding="UTF-8"?>
<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="http://openrosa.org/javarosa">
<h:head>
<h:title>Vehicle log</h:title>
<model>
<instance>
<Vehicle_log id="Vehicle_log">
<Date/>
<OdoStart/>
<OdoEnd/>
<TripDistance/>
<Driver>Jacques</Driver>
<FuelCosts>0</FuelCosts>
<RefuelMileage>0</RefuelMileage>
<TollFees>0</TollFees>
<Remarks>None</Remarks>
</Vehicle_log>
</instance>
<bind id="Date" nodeset="/Vehicle_log/Date" type="xsd:date"
required="true()"/>
<bind id="OdoStart" nodeset="/Vehicle_log/OdoStart"
type="xsd:int" required="true()"/>
<bind id="OdoEnd" nodeset="/Vehicle_log/OdoEnd" type="xsd:int"
required="true()"/>
<bind id="TripDistance" nodeset="/Vehicle_log/TripDistance"
type="xsd:int" calculate="/Vehicle_log/OdoEnd - /Vehicle_log/OdoStart"/

  &lt;bind id=&quot;Driver&quot; nodeset=&quot;/Vehicle\_log/Driver&quot;

type="xsd:string"/>
<bind id="FuelCosts" nodeset="/Vehicle_log/FuelCosts"
type="xsd:decimal"/>
<bind id="RefuelMileage" nodeset="/Vehicle_log/RefuelMileage"
type="xsd:int" required="true()" relevant="/Vehicle_log/FuelCosts !=
0"/>
<bind id="TollFees" nodeset="/Vehicle_log/TollFees"
type="xsd:decimal"/>
<bind id="Remarks" nodeset="/Vehicle_log/Remarks"
type="xsd:string"/>
<itext>
<translation lang="English">
<text id="Date">
<value>Enter date</value>
</text>
<text id="OdoStart">
<value>Odometer start</value>
</text>
<text id="OdoEnd">
<value>Odometer end</value>
</text>
<text id="TripDistance">
<value>Trip distance</value>
</text>
<text id="Driver">
<value>Driver</value>
</text>
<text id="Driver-hint">
<value>If driver is not Jacques, enter new name</value>
</text>
<text id="FuelCosts">
<value>Fuel costs</value>
</text>
<text id="RefuelMileage">
<value>Mileage at refuel</value>
</text>
<text id="TollFees">
<value>Toll fees</value>
</text>
<text id="Remarks">
<value>Remarks</value>
</text>
<text id="Remarks-hint">
<value>Incidents, etc.</value>
</text>
</translation>
</itext>
</model>
</h:head>
<h:body>
<input bind="Date">
<label ref="jr:itext('Date')"/>
</input>
<input bind="OdoStart">
<label ref="jr:itext('OdoStart')"/>
</input>
<input bind="OdoEnd">
<label ref="jr:itext('OdoEnd')"/>
</input>
<input bind="TripDistance">
<label ref="jr:itext('TripDistance')"/>
</input>
<input bind="Driver">
<label ref="jr:itext('Driver')"/>
<hint ref="jr:itext('Driver-hint')"/>
</input>
<input bind="FuelCosts">
<label ref="jr:itext('FuelCosts')"/>
</input>
<input bind="RefuelMileage">
<label ref="jr:itext('RefuelMileage')"/>
</input>
<input bind="TollFees">
<label ref="jr:itext('TollFees')"/>
</input>
<input bind="Remarks">
<label ref="jr:itext('Remarks')"/>
<hint ref="jr:itext('Remarks-hint')"/>
</input>
</h:body>
</h:html>

Bergie,

Your BIND looks correct to me…what happens when you run it on the phone?

there are other ways to do this, the following allows NULL values, but if the FuelCost question is not answered, then the Refuel Mileage question is never asked.

  <bind id="FuelCost" nodeset="/new_form1/FuelCost" type="xsd:int" required="true()"/>

  <bind id="RefuelMileage" nodeset="/new_form1/RefuelMileage" type="xsd:int" required="true()" relevant="/new_form1/FuelCost != "/>

~Neil

Maybe I am being misunderstood.
The reason I posted was to report that once I am using a form with
default values set, it does not display on the phone or are being
uploaded. I tested my form as is with ODK collect and GC Mobile. Both
of them show the default values and upload it. I am not looking for
ways to "work with null values" when I want two fields to be
subtracted from one another. I know too little to go above the simple
means of WYSIWYG. I expect a default value in Kobo, but don't see it.
Please relook at what Kobo does with the default values when filling
in forms.
Regards

···

On Nov 11, 11:55 pm, Neil Hendrick <neil.h...@kobotoolbox.org> wrote:

Bergie,

Your BIND looks correct to me...what happens when you run it on the phone?

<bind id="RefuelMileage" nodeset="/Vehicle_log/RefuelMileage"
type="xsd:int" required="true()" relevant="/Vehicle_log/FuelCosts !=0"/>

there are other ways to do this, the following allows NULL values, but if
the FuelCost question is not answered, then the Refuel Mileage question is
never asked.

  &lt;bind id=&quot;FuelCost&quot; nodeset=&quot;/new\_form1/FuelCost&quot; type=&quot;xsd:int&quot;

required="true()"/>
<bind id="RefuelMileage" nodeset="/new_form1/RefuelMileage"
type="xsd:int" required="true()" relevant="/new_form1/FuelCost != "/>

~Neil

I’m sorry, I get you now, let me take another look and see if I can reproduce your problem.
~N

···

On Mon, Nov 14, 2011 at 4:29 AM, Bergie bergi...@gmail.com wrote:

Maybe I am being misunderstood.

The reason I posted was to report that once I am using a form with

default values set, it does not display on the phone or are being

uploaded. I tested my form as is with ODK collect and GC Mobile. Both

of them show the default values and upload it. I am not looking for

ways to “work with null values” when I want two fields to be

subtracted from one another. I know too little to go above the simple

means of WYSIWYG. I expect a default value in Kobo, but don’t see it.

Please relook at what Kobo does with the default values when filling

in forms.

Regards

On Nov 11, 11:55 pm, Neil Hendrick neil.h...@kobotoolbox.org > > wrote:

Bergie,

Your BIND looks correct to me…what happens when you run it on the phone?

<bind id=“RefuelMileage” nodeset="/Vehicle_log/RefuelMileage"

type=“xsd:int” required=“true()” relevant="/Vehicle_log/FuelCosts !=0"/>

there are other ways to do this, the following allows NULL values, but if

the FuelCost question is not answered, then the Refuel Mileage question is

never asked.

  <bind id="FuelCost" nodeset="/new_form1/FuelCost" type="xsd:int"

required=“true()”/>

  <bind id="RefuelMileage" nodeset="/new_form1/RefuelMileage"

type=“xsd:int” required=“true()” relevant="/new_form1/FuelCost != "/>

~Neil

You received this message because you are subscribed to the Google Groups “Kobo Users” group.

To post to this group, send email to kobo-...@googlegroups.com.

To unsubscribe from this group, send email to kobo-users+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/kobo-users?hl=en.