Prelaoding Data from SCV file, and Seting the preloaded values to View Elements

We are not able to set the value of pre-loaded text to a input Text Field.

We pre-load data from a CSV file, and use the setvalue action of the event
xforms-model-construct-done to set the text.

Unfortunately this is not working.

See the attached;

  1. the XLSForm (testa.xls),

  2. the generated xform (testa.xml) -

Modified by adding the following line to register setvalue action on event
xforms-model-construct-done

<orx:setvalue ev:event="xforms-model-construct-done" ref="/testa/bldg"
value="/testa/bldg_temp"/>

  1. The csv file (test.csv)

To test the form, enter a building search criteria such as: *Bui *or *View;
*select the building and continue to the end.

Even though the data element is loaded from the CSV (via bldg_temp), we
have not been able to set the loaded value to a view text element.

Any help???

test.csv (99 Bytes)

testa.xls (1.44 MB)

testa.xml (2.87 KB)

Info,

The pre-loading support in ODK only allows you to pre-load into calculate
fields -- not into user-editable fields like text fields. This is due to
a more general limitation: the default values for user-editable fields
cannot be dynamically calculated in ODK.

We have removed these restrictions in SurveyCTO, but I presume that you're
using a non-SurveyCTO version of ODK. (And unfortunately, our support for
calculated field defaults is unlikely to become part of ODK more widely
because it required some violence to the underlying JavaRosa standard and
implementation. Occasionally we do crazy things in SurveyCTO that would not
be considered acceptable for the wider platform, which seeks to adhere to
certain open standards.)

Best,

Chris

··· --- Christopher Robert Dobility, Inc. (SurveyCTO) http://www.surveycto.com/ http://blog.surveycto.com/

On Wed, Oct 28, 2015 at 10:19 AM geoenginfo info@geoengsystems.com wrote:

We are not able to set the value of pre-loaded text to a input Text Field.

We pre-load data from a CSV file, and use the setvalue action of the event
xforms-model-construct-done to set the text.

Unfortunately this is not working.

See the attached;

  1. the XLSForm (testa.xls),

  2. the generated xform (testa.xml) -

Modified by adding the following line to register setvalue action on
event xforms-model-construct-done

<orx:setvalue ev:event="xforms-model-construct-done" ref="/testa/bldg"
value="/testa/bldg_temp"/>

  1. The csv file (test.csv)

To test the form, enter a building search criteria such as: *Bui *or *View;
*select the building and continue to the end.

Even though the data element is loaded from the CSV (via bldg_temp), we
have not been able to set the loaded value to a view text element.

Any help???

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Chris, Good to hear this; I have been breaking my head throughout
today!!!

Now tell me,

I have preloaded the data using the calculate field in the model, as
follows:

and also note a few more bindings in the model:

and in the view:

<input ref="/testa/bldg">
  <label>Building Status</label>
</input>

So I thought I can set the value in the model, referenced by the view,
before the user starts to interact with the forms as follows:

<orx:setvalue ev:event="xforms-model-construct-done" ref="/testa/bldg"
value="/testa/bldg_temp"/>

You mean this is not possible in ODK?

··· On Wednesday, October 28, 2015 at 5:26:39 PM UTC+3, Christopher Robert wrote: > > Info, > > The pre-loading support in ODK only allows you to pre-load into > *calculate* fields -- not into user-editable fields like *text* fields. > This is due to a more general limitation: the default values for > user-editable fields cannot be dynamically calculated in ODK. > > We have removed these restrictions in SurveyCTO, but I presume that you're > using a non-SurveyCTO version of ODK. (And unfortunately, our support for > calculated field defaults is unlikely to become part of ODK more widely > because it required some violence to the underlying JavaRosa standard and > implementation. Occasionally we do crazy things in SurveyCTO that would not > be considered acceptable for the wider platform, which seeks to adhere to > certain open standards.) > > Best, > > Chris > > --- > Christopher Robert > Dobility, Inc. (SurveyCTO) > http://www.surveycto.com/ > http://blog.surveycto.com/ > > On Wed, Oct 28, 2015 at 10:19 AM geoenginfo <in...@geoengsystems.com > wrote: > >> We are not able to set the value of pre-loaded text to a input Text Field. >> >> We pre-load data from a CSV file, and use the setvalue action of the >> event xforms-model-construct-done to set the text. >> >> Unfortunately this is not working. >> >> See the attached; >> >> 1. the XLSForm (testa.xls), >> >> 2. the generated xform (testa.xml) - >> >> Modified by adding the following line to register setvalue action on >> event xforms-model-construct-done >> >> > value="/testa/bldg_temp"/> >> >> 3. The csv file (test.csv) >> >> To test the form, enter a building search criteria such as: *Bui *or *View; >> *select the building and continue to the end. >> >> Even though the data element is loaded from the CSV (via bldg_temp), we >> have not been able to set the loaded value to a view text element. >> >> Any help??? >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "ODK Community" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> >

Hi Info,

I don't think that's at all possible -- but I'm open to somebody else
correcting me. I could be wrong!

Chris

··· On Wed, Oct 28, 2015 at 11:47 AM geoenginfo wrote:

Hi Chris, Good to hear this; I have been breaking my head throughout
today!!!

Now tell me,

I have preloaded the data using the calculate field in the model, as
follows:

and also note a few more bindings in the model:

and in the view:

<input ref="/testa/bldg">
  <label>Building Status</label>
</input>

So I thought I can set the value in the model, referenced by the view,
before the user starts to interact with the forms as follows:

<orx:setvalue ev:event="xforms-model-construct-done" ref="/testa/bldg"
value="/testa/bldg_temp"/>

You mean this is not possible in ODK?

On Wednesday, October 28, 2015 at 5:26:39 PM UTC+3, Christopher Robert wrote:

Info,

The pre-loading support in ODK only allows you to pre-load into
calculate fields -- not into user-editable fields like text fields.
This is due to a more general limitation: the default values for
user-editable fields cannot be dynamically calculated in ODK.

We have removed these restrictions in SurveyCTO, but I presume that
you're using a non-SurveyCTO version of ODK. (And unfortunately, our
support for calculated field defaults is unlikely to become part of ODK
more widely because it required some violence to the underlying JavaRosa
standard and implementation. Occasionally we do crazy things in SurveyCTO
that would not be considered acceptable for the wider platform, which seeks
to adhere to certain open standards.)

Best,

Chris


Christopher Robert
Dobility, Inc. (SurveyCTO)
http://www.surveycto.com/
http://blog.surveycto.com/

On Wed, Oct 28, 2015 at 10:19 AM geoenginfo in...@geoengsystems.com wrote:

We are not able to set the value of pre-loaded text to a input Text Field.

We pre-load data from a CSV file, and use the setvalue action of the
event xforms-model-construct-done to set the text.

Unfortunately this is not working.

See the attached;

  1. the XLSForm (testa.xls),

  2. the generated xform (testa.xml) -

Modified by adding the following line to register setvalue action on
event xforms-model-construct-done

<orx:setvalue ev:event="xforms-model-construct-done" ref="/testa/bldg"
value="/testa/bldg_temp"/>

  1. The csv file (test.csv)

To test the form, enter a building search criteria such as: *Bui *or *View;
*select the building and continue to the end.

Even though the data element is loaded from the CSV (via bldg_temp), we
have not been able to set the loaded value to a view text element.

Any help???

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups "ODK Community" group.

To unsubscribe from this group and stop receiving emails from it, send an

email to opendatakit...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

may or may not be fully implemented in the JR version used by
ODK Collect.

It is an XForms feature that was not in the original JR codebase but was
added by Dimagi / Commcare with the intention to eventually replace the
jr:preload extensions with this native XForms functionality.

The JR version used by ODK Collect has at least some of the code to support
, but we have never attempted to use it and have not applied any
bug fixes or patches from the upstream Dimagi contributions in a
considerable while. And we may never do so, as our code trees have
dramatically diverged.

··· On Wed, Oct 28, 2015 at 8:55 AM, Christopher Robert wrote:

Hi Info,

I don't think that's at all possible -- but I'm open to somebody else
correcting me. I could be wrong!

Chris

On Wed, Oct 28, 2015 at 11:47 AM geoenginfo info@geoengsystems.com wrote:

Hi Chris, Good to hear this; I have been breaking my head throughout
today!!!

Now tell me,

I have preloaded the data using the calculate field in the model, as
follows:

and also note a few more bindings in the model:

and in the view:

<input ref="/testa/bldg">
  <label>Building Status</label>
</input>

So I thought I can set the value in the model, referenced by the view,
before the user starts to interact with the forms as follows:

<orx:setvalue ev:event="xforms-model-construct-done" ref="/testa/bldg"
value="/testa/bldg_temp"/>

You mean this is not possible in ODK?

On Wednesday, October 28, 2015 at 5:26:39 PM UTC+3, Christopher Robert wrote:

Info,

The pre-loading support in ODK only allows you to pre-load into
calculate fields -- not into user-editable fields like text fields.
This is due to a more general limitation: the default values for
user-editable fields cannot be dynamically calculated in ODK.

We have removed these restrictions in SurveyCTO, but I presume that
you're using a non-SurveyCTO version of ODK. (And unfortunately, our
support for calculated field defaults is unlikely to become part of ODK
more widely because it required some violence to the underlying JavaRosa
standard and implementation. Occasionally we do crazy things in SurveyCTO
that would not be considered acceptable for the wider platform, which seeks
to adhere to certain open standards.)

Best,

Chris


Christopher Robert
Dobility, Inc. (SurveyCTO)
http://www.surveycto.com/
http://blog.surveycto.com/

On Wed, Oct 28, 2015 at 10:19 AM geoenginfo in...@geoengsystems.com wrote:

We are not able to set the value of pre-loaded text to a input Text Field.

We pre-load data from a CSV file, and use the setvalue action of the
event xforms-model-construct-done to set the text.

Unfortunately this is not working.

See the attached;

  1. the XLSForm (testa.xls),

  2. the generated xform (testa.xml) -

Modified by adding the following line to register setvalue action on
event xforms-model-construct-done

<orx:setvalue ev:event="xforms-model-construct-done" ref="/testa/bldg"
value="/testa/bldg_temp"/>

  1. The csv file (test.csv)

To test the form, enter a building search criteria such as: *Bui *or *View;
*select the building and continue to the end.

Even though the data element is loaded from the CSV (via bldg_temp), we
have not been able to set the loaded value to a view text element.

Any help???

--

Post: opend...@googlegroups.com

Unsubscribe: opendatakit...@googlegroups.com

Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups "ODK Community" group.

To unsubscribe from this group and stop receiving emails from it, send

an email to opendatakit...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Fyi, here is high level overview of differences with CommCare
(afaik): https://github.com/opendatakit/odk-xform-spec/issues/33

··· On Wednesday, October 28, 2015 at 12:33:56 PM UTC-6, Mitch Sundt wrote: > > may or may not be fully implemented in the JR version used by > ODK Collect. > > It is an XForms feature that was not in the original JR codebase but was > added by Dimagi / Commcare with the intention to eventually replace the > jr:preload extensions with this native XForms functionality. > > The JR version used by ODK Collect has at least some of the code to > support , but we have never attempted to use it and have not > applied any bug fixes or patches from the upstream Dimagi contributions in > a considerable while. And we may never do so, as our code trees have > dramatically diverged. > > > > On Wed, Oct 28, 2015 at 8:55 AM, Christopher Robert <cro...@surveycto.com > wrote: > >> Hi Info, >> >> I don't think that's at all possible -- but I'm open to somebody else >> correcting me. I could be wrong! >> >> Chris >> >> On Wed, Oct 28, 2015 at 11:47 AM geoenginfo <in...@geoengsystems.com > wrote: >> >>> Hi Chris, Good to hear this; I have been breaking my head throughout >>> today!!! >>> >>> Now tell me, >>> >>> I have preloaded the data using the calculate field in the model, as >>> follows: >>> >>> >> type="string"/> >>> >>> and also note a few more bindings in the model: >>> >>> >>> >>> and in the view: >>> >>> >>> Building Status >>> >>> >>> So I thought I can set the value in the model, referenced by the view, >>> before the user starts to interact with the forms as follows: >>> >>> >>> >> value="/testa/bldg_temp"/> >>> >>> You mean this is not possible in ODK? >>> >>> >>> >>> On Wednesday, October 28, 2015 at 5:26:39 PM UTC+3, Christopher Robert wrote: >>> >>>> Info, >>>> >>>> The pre-loading support in ODK only allows you to pre-load into >>>> *calculate* fields -- not into user-editable fields like *text* >>>> fields. This is due to a more general limitation: the default values for >>>> user-editable fields cannot be dynamically calculated in ODK. >>>> >>>> We have removed these restrictions in SurveyCTO, but I presume that >>>> you're using a non-SurveyCTO version of ODK. (And unfortunately, our >>>> support for calculated field defaults is unlikely to become part of ODK >>>> more widely because it required some violence to the underlying JavaRosa >>>> standard and implementation. Occasionally we do crazy things in SurveyCTO >>>> that would not be considered acceptable for the wider platform, which seeks >>>> to adhere to certain open standards.) >>>> >>>> Best, >>>> >>>> Chris >>>> >>>> --- >>>> Christopher Robert >>>> Dobility, Inc. (SurveyCTO) >>>> http://www.surveycto.com/ >>>> http://blog.surveycto.com/ >>>> >>>> On Wed, Oct 28, 2015 at 10:19 AM geoenginfo wrote: >>>> >>> We are not able to set the value of pre-loaded text to a input Text >>>>> Field. >>>>> >>>>> We pre-load data from a CSV file, and use the setvalue action of the >>>>> event xforms-model-construct-done to set the text. >>>>> >>>>> Unfortunately this is not working. >>>>> >>>>> See the attached; >>>>> >>>>> 1. the XLSForm (testa.xls), >>>>> >>>>> 2. the generated xform (testa.xml) - >>>>> >>>>> Modified by adding the following line to register setvalue action on >>>>> event xforms-model-construct-done >>>>> >>>>> >>>> ref="/testa/bldg" value="/testa/bldg_temp"/> >>>>> >>>>> 3. The csv file (test.csv) >>>>> >>>>> To test the form, enter a building search criteria such as: *Bui *or *View; >>>>> *select the building and continue to the end. >>>>> >>>>> Even though the data element is loaded from the CSV (via bldg_temp), >>>>> we have not been able to set the loaded value to a view text element. >>>>> >>>>> Any help??? >>>>> >>>>> -- >>>>> -- >>>>> >>>> Post: opend...@googlegroups.com >>>>> Unsubscribe: opendatakit...@googlegroups.com >>>> >>>> >>>>> Options: http://groups.google.com/group/opendatakit?hl=en >>>>> >>>>> --- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "ODK Community" group. >>>>> >>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to opendatakit...@googlegroups.com. >>>> >>>> >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> -- >>> -- >>> Post: opend...@googlegroups.com >>> Unsubscribe: opendatakit...@googlegroups.com >>> Options: http://groups.google.com/group/opendatakit?hl=en >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "ODK Community" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to opendatakit...@googlegroups.com . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "ODK Community" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to opendatakit...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >