X Forms question

Hey everyone,

I am new to XForms and XML. I have started creating my own forms and
using them with ODKAggregate and Collect. However, there is a slight
coding problem I can't figure out because I just do not know XML that
well. I am using the control which will allow a user to
check off multiple answers at one time. My goal is to have another
question follow if only one particular answer is checked off. Here is
my code:

<h:html xmlns="http://www.w3.org/2002/xforms"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa">
<h:head>
<h:title>Treatement Sample</h:title>

	<model>
		<instance>
			<data id="treatment">
				<description />
				<LPM />
			</data>
		</instance>

		<bind nodeset="LPM" type="int" relevant="/data/

description='o2_nasal_mask'"/>

</h:head>

<h:body>
	<!-- This is where we define the questions that the user will fill

out -->

Check off all applied treatments:

OB Delivery
ob_delivery


Suction
suction


O2 Nasal / Mask
o2_nasal_mask


Other
other

	<input ref="LPM">
		<label>Enter LPM reading:</label>
	</input>
</h:body>

</h:html>

I want the LPM question to follow only if "O2 Nasal/Mask" is
checked off. The way I have the code now this will only work if a
user only checks off O2 Nasal/Mask. However, if the user checks off
O2 Nasal/Mask and anything else, this won't work. I understand that
when a user checks off more than one answer in a control,
then all choices are stored in the instance with a space between
them. Thus, the way I have the
binding for LPM defined will not work:

Does XML have wildcard characters that I can use so the binding
reference looks something like:

assuming * is a wildcard character that I can use in this context. I
actually tried that and it didn't work.

Are there any other web resources I can access to get these types of
questions answered about XML if this is not the appropriate forum for
these types of question?

Thanks,
Eric

eric,

http://code.javarosa.org/wiki/xform has a description of the spec and
http://code.javarosa.org/wiki/buildxforms is a good tutorial on how to
build forms. we also have a repository of sample forms at
http://code.google.com/p/opendatakit/source/browse?repo=forms.

pasting xml in an email is not optimal, so we recommend if you have
forms you want us to look at, use http://dpaste.com and email a link
instead.

in this case, your select control is referencing "treatment" when it
should be referencing "description". i've put an updated form at
http://dpaste.com/218157

hope that helps,

yaw

··· On Wed, Jul 14, 2010 at 09:35, ep_me wrote: > Hey everyone, > > I am new to XForms and XML. I have started creating my own forms and > using them with ODKAggregate and Collect. However, there is a slight > coding problem I can't figure out because I just do not know XML that > well. I am using the control which will allow a user to > check off multiple answers at one time. My goal is to have another > question follow if only one particular answer is checked off. Here is > my code: > > xmlns:h="http://www.w3.org/1999/xhtml" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:jr="http://openrosa.org/javarosa"> > > Treatement Sample > > > > > > > > > > > > > > > > > Check off all applied treatments: > > OB Delivery > ob_delivery > > > Suction > suction > > > O2 Nasal / Mask > o2_nasal_mask > > > Other > other > > > > > Enter LPM reading: > > > > > I want the LPM question to follow only if "O2 Nasal/Mask" is > checked off. The way I have the code now this will only work if a > user only checks off O2 Nasal/Mask. However, if the user checks off > O2 Nasal/Mask and anything else, this won't work. I understand that > when a user checks off more than one answer in a control, > then all choices are stored in the instance with a space between > them. Thus, the way I have the > binding for LPM defined will not work: > > > > Does XML have wildcard characters that I can use so the binding > reference looks something like: > > > > assuming * is a wildcard character that I can use in this context. I > actually tried that and it didn't work. > > Are there any other web resources I can access to get these types of > questions answered about XML if this is not the appropriate forum for > these types of question? > > Thanks, > Eric > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

try using relevant=selected(data/description, 'o2_nasal_mask')

··· On Jul 14, 2010, at 10:35 PM, ep_me wrote:

Hey everyone,

I am new to XForms and XML. I have started creating my own forms and
using them with ODKAggregate and Collect. However, there is a slight
coding problem I can't figure out because I just do not know XML that
well. I am using the control which will allow a user to
check off multiple answers at one time. My goal is to have another
question follow if only one particular answer is checked off. Here is
my code:

<h:html xmlns="http://www.w3.org/2002/xforms"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa">
<h:head>
<h:title>Treatement Sample</h:title>

  <model>
  	<instance>
  		<data id="treatment">
  			<description />
  			<LPM />
  		</data>
  	</instance>

  	<bind nodeset="LPM" type="int" relevant="/data/

description='o2_nasal_mask'"/>

</h:head>

<h:body>


Check off all applied treatments:

OB Delivery
ob_delivery


Suction
suction


O2 Nasal / Mask
o2_nasal_mask


Other
other

  <input ref="LPM">
  	<label>Enter LPM reading:</label>
  </input>

</h:body>
</h:html>

I want the LPM question to follow only if "O2 Nasal/Mask" is
checked off. The way I have the code now this will only work if a
user only checks off O2 Nasal/Mask. However, if the user checks off
O2 Nasal/Mask and anything else, this won't work. I understand that
when a user checks off more than one answer in a control,
then all choices are stored in the instance with a space between
them. Thus, the way I have the
binding for LPM defined will not work:

Does XML have wildcard characters that I can use so the binding
reference looks something like:

assuming * is a wildcard character that I can use in this context. I
actually tried that and it didn't work.

Are there any other web resources I can access to get these types of
questions answered about XML if this is not the appropriate forum for
these types of question?

Thanks,
Eric

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

Thank you Andrew. Your suggestion worked great. And Yaw, I used
http://code.javarosa.org/wiki/buildxforms

It was helpful in teaching me the basics. However, I was looking to
see where I can learn how to do more complicated things. I don't
think it showed what I was trying to do above anywhere in the
tutorial. Thanks for letting me know about dpaste.com.

··· On Jul 14, 1:25 pm, Yaw Anokwa wrote: > eric, > > http://code.javarosa.org/wiki/xformhas a description of the spec andhttp://code.javarosa.org/wiki/buildxformsis a good tutorial on how to > build forms. we also have a repository of sample forms athttp://code.google.com/p/opendatakit/source/browse?repo=forms. > > pasting xml in an email is not optimal, so we recommend if you have > forms you want us to look at, usehttp://dpaste.comand email a link > instead. > > in this case, your select control is referencing "treatment" when it > should be referencing "description". i've put an updated form athttp://dpaste.com/218157 > > hope that helps, > > yaw > > On Wed, Jul 14, 2010 at 09:35, ep_me wrote: > > Hey everyone, > > > I am new to XForms and XML. I have started creating my own forms and > > using them with ODKAggregate and Collect. However, there is a slight > > coding problem I can't figure out because I just do not know XML that > > well. I am using the control which will allow a user to > > check off multiple answers at one time. My goal is to have another > > question follow if only one particular answer is checked off. Here is > > my code: > > > > xmlns:h="http://www.w3.org/1999/xhtml" > > xmlns:ev="http://www.w3.org/2001/xml-events" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > xmlns:jr="http://openrosa.org/javarosa"> > > > > Treatement Sample > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Check off all applied treatments: > > > > OB Delivery > > ob_delivery > > > > > > Suction > > suction > > > > > > O2 Nasal / Mask > > o2_nasal_mask > > > > > > Other > > other > > > > > > > > > Enter LPM reading: > > > > > > > > > I want the LPM question to follow only if "O2 Nasal/Mask" is > > checked off. The way I have the code now this will only work if a > > user only checks off O2 Nasal/Mask. However, if the user checks off > > O2 Nasal/Mask and anything else, this won't work. I understand that > > when a user checks off more than one answer in a control, > > then all choices are stored in the instance with a space between > > them. Thus, the way I have the > > binding for LPM defined will not work: > > > > > > Does XML have wildcard characters that I can use so the binding > > reference looks something like: > > > > > > assuming * is a wildcard character that I can use in this context. I > > actually tried that and it didn't work. > > > Are there any other web resources I can access to get these types of > > questions answered about XML if this is not the appropriate forum for > > these types of question? > > > Thanks, > > Eric > > > -- > > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options:http://groups.google.com/group/opendatakit?hl=en > >

Thanks for this thread it contains tons of helpful resources!

I have four followup questions about how XForms tie in with ODK Collect
—it appears that ODK hands off the XML parsing of the xform entirely
to the JavaRosa library--[1] is ODK using the JavaRosa library as-is,
or have modifications been made to the jar packaging?

[2] I am new to XForm technology and want to know what parts of the
API are supported by ODK(i.e. are they identical to what javarosa
supports).

[3] Are these features in particular supported (and where can I find
examples or documentation):
-Have a select field load its options from an external location and
not hardcoded in the xform (sqlitedb, sdcard flatfile, etc)
-Have an AutoComplete field (based against values in sqlitedb, sdcard
flatfile, etc)

[4] What XForm generating applications are recommended by your team?

Thank you,
Adjoa

··· On Jul 14, 7:27 pm, ep_me wrote: > Thank you Andrew. Your suggestion worked great. And Yaw, I usedhttp://code.javarosa.org/wiki/buildxforms > > It was helpful in teaching me the basics. However, I was looking to > see where I can learn how to do more complicated things. I don't > think it showed what I was trying to do above anywhere in the > tutorial. Thanks for letting me know about dpaste.com. > > On Jul 14, 1:25 pm, Yaw Anokwa wrote: > > > eric, > > >http://code.javarosa.org/wiki/xformhasa description of the spec andhttp://code.javarosa.org/wiki/buildxformsisa good tutorial on how to > > build forms. we also have a repository of sample forms athttp://code.google.com/p/opendatakit/source/browse?repo=forms. > > > pasting xml in an email is not optimal, so we recommend if you have > > forms you want us to look at, usehttp://dpaste.comandemail a link > > instead. > > > in this case, your select control is referencing "treatment" when it > > should be referencing "description". i've put an updatedformathttp://dpaste.com/218157 > > > hope that helps, > > > yaw > > > On Wed, Jul 14, 2010 at 09:35, ep_me wrote: > > > Hey everyone, > > > > I am new to XForms and XML. I have started creating my own forms and > > > using them with ODKAggregate and Collect. However, there is a slight > > > coding problem I can't figure out because I just do not know XML that > > > well. I am using the control which will allow a user to > > > check off multiple answers at one time. My goal is to have another > > > question follow if only one particular answer is checked off. Here is > > > my code: > > > > > > xmlns:h="http://www.w3.org/1999/xhtml" > > > xmlns:ev="http://www.w3.org/2001/xml-events" > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > xmlns:jr="http://openrosa.org/javarosa"> > > > > > > Treatement Sample > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Check off all applied treatments: > > > > > > OB Delivery > > > ob_delivery > > > > > > > > > Suction > > > suction > > > > > > > > > O2 Nasal / Mask > > > o2_nasal_mask > > > > > > > > > Other > > > other > > > > > > > > > > > > > Enter LPM reading: > > > > > > > > > > > > > I want the LPM question to follow only if "O2 Nasal/Mask" is > > > checked off. The way I have the code now this will only work if a > > > user only checks off O2 Nasal/Mask. However, if the user checks off > > > O2 Nasal/Mask and anything else, this won't work. I understand that > > > when a user checks off more than one answer in a control, > > > then all choices are stored in the instance with a space between > > > them. Thus, the way I have the > > > binding for LPM defined will not work: > > > > > > > > Does XML have wildcard characters that I can use so the binding > > > reference looks something like: > > > > > > > > assuming * is a wildcard character that I can use in this context. I > > > actually tried that and it didn't work. > > > > Are there any other web resources I can access to get these types of > > > questions answered about XML if this is not the appropriate forum for > > > these types of question? > > > > Thanks, > > > Eric > > > > -- > > > Post: opendatakit@googlegroups.com > > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > > Options:http://groups.google.com/group/opendatakit?hl=en
  1. we use the javarosa library as is released. if we do need to add
    something new, we add it to that codebase and release it with the
    community.

  2. basically, this is true, but some of it is device specific.
    javarosa supports gps, but not all j2me devices have that hardware
    support. we try really hard to keep everything compatible and when
    they can't be, it degrades gracefully.

  3. itemsets are a frequently requested feature. basic support is in
    the javarosa core (and thus odk), but we need to add filtering and
    database connections before it's really useful. it's very high on the
    todo list.

  4. you can use odk build or purcforms to generate simple forms.
    complex forms are best built by hand.

··· On Mon, Jul 19, 2010 at 13:48, adjoa wrote: > Thanks for this thread it contains tons of helpful resources! > > I have four followup questions about how XForms tie in with ODK Collect > —it appears that ODK hands off the XML parsing of the xform entirely > to the JavaRosa library--[1] is ODK using the JavaRosa library as-is, > or have modifications been made to the jar packaging? > > [2] I am new to XForm technology and want to know what parts of the > API are supported by ODK(i.e. are they identical to what javarosa > supports). > > [3] Are these features in particular supported (and where can I find > examples or documentation): > -Have a select field load its options from an external location and > not hardcoded in the xform (sqlitedb, sdcard flatfile, etc) > -Have an AutoComplete field (based against values in sqlitedb, sdcard > flatfile, etc) > > [4] What XForm generating applications are recommended by your team? > > Thank you, > Adjoa > > > > > > > > On Jul 14, 7:27 pm, ep_me wrote: >> Thank you Andrew. Your suggestion worked great. And Yaw, I usedhttp://code.javarosa.org/wiki/buildxforms >> >> It was helpful in teaching me the basics. However, I was looking to >> see where I can learn how to do more complicated things. I don't >> think it showed what I was trying to do above anywhere in the >> tutorial. Thanks for letting me know about dpaste.com. >> >> On Jul 14, 1:25 pm, Yaw Anokwa wrote: >> >> > eric, >> >> >http://code.javarosa.org/wiki/xformhasa description of the spec andhttp://code.javarosa.org/wiki/buildxformsisa good tutorial on how to >> > build forms. we also have a repository of sample forms athttp://code.google.com/p/opendatakit/source/browse?repo=forms. >> >> > pasting xml in an email is not optimal, so we recommend if you have >> > forms you want us to look at, usehttp://dpaste.comandemail a link >> > instead. >> >> > in this case, your select control is referencing "treatment" when it >> > should be referencing "description". i've put an updatedformathttp://dpaste.com/218157 >> >> > hope that helps, >> >> > yaw >> >> > On Wed, Jul 14, 2010 at 09:35, ep_me wrote: >> > > Hey everyone, >> >> > > I am new to XForms and XML. I have started creating my own forms and >> > > using them with ODKAggregate and Collect. However, there is a slight >> > > coding problem I can't figure out because I just do not know XML that >> > > well. I am using the control which will allow a user to >> > > check off multiple answers at one time. My goal is to have another >> > > question follow if only one particular answer is checked off. Here is >> > > my code: >> >> > > > > > xmlns:h="http://www.w3.org/1999/xhtml" >> > > xmlns:ev="http://www.w3.org/2001/xml-events" >> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" >> > > xmlns:jr="http://openrosa.org/javarosa"> >> > > >> > > Treatement Sample >> >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> >> > > >> > > >> > > >> >> > > >> > > >> > > >> > > Check off all applied treatments: >> > > >> > > OB Delivery >> > > ob_delivery >> > > >> > > >> > > Suction >> > > suction >> > > >> > > >> > > O2 Nasal / Mask >> > > o2_nasal_mask >> > > >> > > >> > > Other >> > > other >> > > >> > > >> >> > > >> > > Enter LPM reading: >> > > >> > > >> > > >> >> > > I want the LPM question to follow only if "O2 Nasal/Mask" is >> > > checked off. The way I have the code now this will only work if a >> > > user only checks off O2 Nasal/Mask. However, if the user checks off >> > > O2 Nasal/Mask and anything else, this won't work. I understand that >> > > when a user checks off more than one answer in a control, >> > > then all choices are stored in the instance with a space between >> > > them. Thus, the way I have the >> > > binding for LPM defined will not work: >> >> > > >> >> > > Does XML have wildcard characters that I can use so the binding >> > > reference looks something like: >> >> > > >> >> > > assuming * is a wildcard character that I can use in this context. I >> > > actually tried that and it didn't work. >> >> > > Are there any other web resources I can access to get these types of >> > > questions answered about XML if this is not the appropriate forum for >> > > these types of question? >> >> > > Thanks, >> > > Eric >> >> > > -- >> > > Post: opendatakit@googlegroups.com >> > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> > > Options:http://groups.google.com/group/opendatakit?hl=en > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

Thank you--this helps in seeing the big picture.

I saw a wiki describing what Javarosa supports of the xform spec--
which confirmed that "itemsets" is on the roadmap. I also saw mention
of "jr preloaders" that seem could be leveraged in the meantime?...

Yaw, I found a thread with your insight on how ODK uses "preloaders"
with the geo-points datatype.

http://groups.google.com/group/javarosa-developers/msg/fa07a0a8595049aa?hl=en

I would like to know more about the "preloaders" as it applies to
ODK...Can you explain where I would introduce my own customized Java
Handler?

(source: http://code.javarosa.org/wiki/xform)
"We also support two custom bind parameters, jr:preload and
jr:preloadParams, used for defaulting in data when the form is loaded.
Normally you'd just hard-code the data in the instance to default it,
but this isn't possible for dynamic data that you want to pre-load
into your instance. Thus, we have these parameters to call out to
various preloaders. A preloader is a Java handler that is registered
with the xforms engine and provides certain kinds of data. The
jr:preload parameter identifies which registered preloader to call out
to; the jr:preloadParams parameter passes information to the preloader
about what kind of data you want back. "

Sincerely,
Adjoa

··· On Jul 19, 5:21 pm, Yaw Anokwa wrote: > 1. we use the javarosa library as is released. if we do need to add > something new, we add it to that codebase and release it with the > community. > > 2. basically, this is true, but some of it is device specific. > javarosa supports gps, but not all j2me devices have that hardware > support. we try really hard to keep everything compatible and when > they can't be, it degrades gracefully. > > 3. itemsets are a frequently requested feature. basic support is in > the javarosa core (and thus odk), but we need to add filtering and > database connections before it's really useful. it's very high on the > todo list. > > 4. you can use odk build or purcforms to generate simple forms. > complex forms are best built by hand. > > On Mon, Jul 19, 2010 at 13:48, adjoa wrote: > > Thanks for this thread it contains tons of helpful resources! > > > I have four followup questions about how XForms tie in with ODK Collect > > —it appears that ODK hands off the XML parsing of the xform entirely > > to the JavaRosa library--[1] is ODK using the JavaRosa library as-is, > > or have modifications been made to the jar packaging? > > > [2] I am new to XForm technology and want to know what parts of the > > API are supported by ODK(i.e. are they identical to what javarosa > > supports). > > > [3] Are these features in particular supported (and where can I find > > examples or documentation): > > -Have a select field load its options from an external location and > > not hardcoded in the xform (sqlitedb, sdcard flatfile, etc) > > -Have an AutoComplete field (based against values in sqlitedb, sdcard > > flatfile, etc) > > > [4] What XForm generating applications are recommended by your team? > > > Thank you, > > Adjoa > > > On Jul 14, 7:27 pm, ep_me wrote: > >> Thank you Andrew. Your suggestion worked great. And Yaw, I usedhttp://code.javarosa.org/wiki/buildxforms > > >> It was helpful in teaching me the basics. However, I was looking to > >> see where I can learn how to do more complicated things. I don't > >> think it showed what I was trying to do above anywhere in the > >> tutorial. Thanks for letting me know about dpaste.com. > > >> On Jul 14, 1:25 pm, Yaw Anokwa wrote: > > >> > eric, > > >> >http://code.javarosa.org/wiki/xformhasadescription of the spec andhttp://code.javarosa.org/wiki/buildxformsisagood tutorial on how to > >> > build forms. we also have a repository of sample forms athttp://code.google.com/p/opendatakit/source/browse?repo=forms. > > >> > pasting xml in an email is not optimal, so we recommend if you have > >> > forms you want us to look at, usehttp://dpaste.comandemaila link > >> > instead. > > >> > in this case, your select control is referencing "treatment" when it > >> > should be referencing "description". i've put an updatedformathttp://dpaste.com/218157 > > >> > hope that helps, > > >> > yaw > > >> > On Wed, Jul 14, 2010 at 09:35, ep_me wrote: > >> > > Hey everyone, > > >> > > I am new to XForms and XML. I have started creating my own forms and > >> > > using them with ODKAggregate and Collect. However, there is a slight > >> > > coding problem I can't figure out because I just do not know XML that > >> > > well. I am using the control which will allow a user to > >> > > check off multiple answers at one time. My goal is to have another > >> > > question follow if only one particular answer is checked off. Here is > >> > > my code: > > >> > > >> > > xmlns:h="http://www.w3.org/1999/xhtml" > >> > > xmlns:ev="http://www.w3.org/2001/xml-events" > >> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > >> > > xmlns:jr="http://openrosa.org/javarosa"> > >> > > > >> > > Treatement Sample > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > > > > >> > > > >> > > > >> > > > > >> > > > >> > > > >> > > > >> > > Check off all applied treatments: > >> > > > >> > > OB Delivery > >> > > ob_delivery > >> > > > >> > > > >> > > Suction > >> > > suction > >> > > > >> > > > >> > > O2 Nasal / Mask > >> > > o2_nasal_mask > >> > > > >> > > > >> > > Other > >> > > other > >> > > > >> > > > > >> > > > >> > > Enter LPM reading: > >> > > > >> > > > >> > > > > >> > > I want the LPM question to follow only if "O2 Nasal/Mask" is > >> > > checked off. The way I have the code now this will only work if a > >> > > user only checks off O2 Nasal/Mask. However, if the user checks off > >> > > O2 Nasal/Mask and anything else, this won't work. I understand that > >> > > when a user checks off more than one answer in a control, > >> > > then all choices are stored in the instance with a space between > >> > > them. Thus, the way I have the > >> > > binding for LPM defined will not work: > > >> > > > > >> > > Does XML have wildcard characters that I can use so the binding > >> > > reference looks something like: > > >> > > > > >> > > assuming * is a wildcard character that I can use in this context. I > >> > > actually tried that and it didn't work. > > >> > > Are there any other web resources I can access to get these types of > >> > > questions answered about XML if this is not the appropriate forum for > >> > > these types of question? > > >> > > Thanks, > >> > > Eric > > >> > > -- > >> > > Post: opendatakit@googlegroups.com > >> > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > >> > > Options:http://groups.google.com/group/opendatakit?hl=en > > > -- > > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options:http://groups.google.com/group/opendatakit?hl=en

preloaders are the same in javarosa and odk -- whatever preloader you
put in javarosa would work in odk. you have to write a javarosa
ipreloadhandler, compile it into the core and then add that new core
to your version of collect. if you take a look at
org.javarosa.core.model.utils.QuestionPreloader you'll see how they
work. if you have questions on the best way to build it,
javarosa-developers@googlegroups.com is the place to be.

an alternative is take a look at ampath's version of odk
(http://code.google.com/p/ampath-odk) where sam has implemented a
widget that loads data form a file.

··· On Tue, Jul 20, 2010 at 15:05, adjoa wrote: > Thank you--this helps in seeing the big picture. > > I saw a wiki describing what Javarosa supports of the xform spec-- > which confirmed that "itemsets" is on the roadmap. I also saw mention > of "jr preloaders" that seem could be leveraged in the meantime?... > > Yaw, I found a thread with your insight on how ODK uses "preloaders" > with the geo-points datatype. > > http://groups.google.com/group/javarosa-developers/msg/fa07a0a8595049aa?hl=en > > I would like to know more about the "preloaders" as it applies to > ODK...Can you explain where I would introduce my own customized Java > Handler? > > (source: http://code.javarosa.org/wiki/xform) > "We also support two custom bind parameters, jr:preload and > jr:preloadParams, used for defaulting in data when the form is loaded. > Normally you'd just hard-code the data in the instance to default it, > but this isn't possible for dynamic data that you want to pre-load > into your instance. Thus, we have these parameters to call out to > various preloaders. A preloader is a Java handler that is registered > with the xforms engine and provides certain kinds of data. The > jr:preload parameter identifies which registered preloader to call out > to; the jr:preloadParams parameter passes information to the preloader > about what kind of data you want back. " > > > Sincerely, > Adjoa > > > > On Jul 19, 5:21 pm, Yaw Anokwa wrote: >> 1. we use the javarosa library as is released. if we do need to add >> something new, we add it to that codebase and release it with the >> community. >> >> 2. basically, this is true, but some of it is device specific. >> javarosa supports gps, but not all j2me devices have that hardware >> support. we try really hard to keep everything compatible and when >> they can't be, it degrades gracefully. >> >> 3. itemsets are a frequently requested feature. basic support is in >> the javarosa core (and thus odk), but we need to add filtering and >> database connections before it's really useful. it's very high on the >> todo list. >> >> 4. you can use odk build or purcforms to generate simple forms. >> complex forms are best built by hand. >> >> On Mon, Jul 19, 2010 at 13:48, adjoa wrote: >> > Thanks for this thread it contains tons of helpful resources! >> >> > I have four followup questions about how XForms tie in with ODK Collect >> > —it appears that ODK hands off the XML parsing of the xform entirely >> > to the JavaRosa library--[1] is ODK using the JavaRosa library as-is, >> > or have modifications been made to the jar packaging? >> >> > [2] I am new to XForm technology and want to know what parts of the >> > API are supported by ODK(i.e. are they identical to what javarosa >> > supports). >> >> > [3] Are these features in particular supported (and where can I find >> > examples or documentation): >> > -Have a select field load its options from an external location and >> > not hardcoded in the xform (sqlitedb, sdcard flatfile, etc) >> > -Have an AutoComplete field (based against values in sqlitedb, sdcard >> > flatfile, etc) >> >> > [4] What XForm generating applications are recommended by your team? >> >> > Thank you, >> > Adjoa >> >> > On Jul 14, 7:27 pm, ep_me wrote: >> >> Thank you Andrew. Your suggestion worked great. And Yaw, I usedhttp://code.javarosa.org/wiki/buildxforms >> >> >> It was helpful in teaching me the basics. However, I was looking to >> >> see where I can learn how to do more complicated things. I don't >> >> think it showed what I was trying to do above anywhere in the >> >> tutorial. Thanks for letting me know about dpaste.com. >> >> >> On Jul 14, 1:25 pm, Yaw Anokwa wrote: >> >> >> > eric, >> >> >> >http://code.javarosa.org/wiki/xformhasadescription of the spec andhttp://code.javarosa.org/wiki/buildxformsisagood tutorial on how to >> >> > build forms. we also have a repository of sample forms athttp://code.google.com/p/opendatakit/source/browse?repo=forms. >> >> >> > pasting xml in an email is not optimal, so we recommend if you have >> >> > forms you want us to look at, usehttp://dpaste.comandemaila link >> >> > instead. >> >> >> > in this case, your select control is referencing "treatment" when it >> >> > should be referencing "description". i've put an updatedformathttp://dpaste.com/218157 >> >> >> > hope that helps, >> >> >> > yaw >> >> >> > On Wed, Jul 14, 2010 at 09:35, ep_me wrote: >> >> > > Hey everyone, >> >> >> > > I am new to XForms and XML. I have started creating my own forms and >> >> > > using them with ODKAggregate and Collect. However, there is a slight >> >> > > coding problem I can't figure out because I just do not know XML that >> >> > > well. I am using the control which will allow a user to >> >> > > check off multiple answers at one time. My goal is to have another >> >> > > question follow if only one particular answer is checked off. Here is >> >> > > my code: >> >> >> > > > >> > > xmlns:h="http://www.w3.org/1999/xhtml" >> >> > > xmlns:ev="http://www.w3.org/2001/xml-events" >> >> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" >> >> > > xmlns:jr="http://openrosa.org/javarosa"> >> >> > > >> >> > > Treatement Sample >> >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> >> >> > > >> >> > > >> >> > > >> >> >> > > >> >> > > >> >> > > >> >> > > Check off all applied treatments: >> >> > > >> >> > > OB Delivery >> >> > > ob_delivery >> >> > > >> >> > > >> >> > > Suction >> >> > > suction >> >> > > >> >> > > >> >> > > O2 Nasal / Mask >> >> > > o2_nasal_mask >> >> > > >> >> > > >> >> > > Other >> >> > > other >> >> > > >> >> > > >> >> >> > > >> >> > > Enter LPM reading: >> >> > > >> >> > > >> >> > > >> >> >> > > I want the LPM question to follow only if "O2 Nasal/Mask" is >> >> > > checked off. The way I have the code now this will only work if a >> >> > > user only checks off O2 Nasal/Mask. However, if the user checks off >> >> > > O2 Nasal/Mask and anything else, this won't work. I understand that >> >> > > when a user checks off more than one answer in a control, >> >> > > then all choices are stored in the instance with a space between >> >> > > them. Thus, the way I have the >> >> > > binding for LPM defined will not work: >> >> >> > > >> >> >> > > Does XML have wildcard characters that I can use so the binding >> >> > > reference looks something like: >> >> >> > > >> >> >> > > assuming * is a wildcard character that I can use in this context. I >> >> > > actually tried that and it didn't work. >> >> >> > > Are there any other web resources I can access to get these types of >> >> > > questions answered about XML if this is not the appropriate forum for >> >> > > these types of question? >> >> >> > > Thanks, >> >> > > Eric >> >> >> > > -- >> >> > > Post: opendatakit@googlegroups.com >> >> > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> >> > > Options:http://groups.google.com/group/opendatakit?hl=en >> >> > -- >> > Post: opendatakit@googlegroups.com >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> > Options:http://groups.google.com/group/opendatakit?hl=en > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >