Closed getodk-bot closed 7 years ago
Comment by mitchellsundt Thursday Jul 09, 2015 at 19:28 GMT
Issue 930 has been merged into this issue.
Reported by mitchellsundt
on 2014-03-13 23:13:44
Comment by mitchellsundt Thursday Jul 09, 2015 at 19:28 GMT
Reported by mitchellsundt
on 2014-03-13 23:14:14
Coming back to this because it's related to #38. This seems like a nice thing to do but unfortunately, I don't think it can be something simple like just an appearance
on an integer input because a range of values also needs to be defined at the form level. I don't think we could use constraints for that. This might be best implemented as an appearance
on the W3C XForms range
control.
I think we should aim for a RangeWidget
with a default appearance using a SeekBar that looks something like:
@dcbriccetti is working on support in JavaRosa (opendatakit/javarosa#44) and has setup a basic wrapper on top of that at #938.
Then we can add a spinner
appearance
to support what this issue originally asked for.
How does that sound?
There's some agreement on appearances at the spec level here: opendatakit/xforms-spec#111
@grzesiek2010 was asking in another conversation about integer vs decimal range
s. That should be determined by the bind in the model.
For example, <bind nodeset="/data/my-int" type="xs:integer"/>
, should result in an integer in the instance for /data/my-int
.
Similarly, <bind nodeset="/data/my-decimal" type="xs:decimal"/>
, should result in a decimal in the instance for /data/my-decimal
.
@grzesiek2010 does that give you enough info to work with? I think basically you'll have to think carefully about the different cases in WidgetFactory.
There might be a follow-up question about validation. What happens with something like:
...
<instance>
<data>
<data1>3.14159</data1>
</data>
</instance>
<bind nodeset="/data/data1" type="xs:integer" />
...
<body>
<range ref="data1" start="1.6" end="5.3" step="0.5" incremental="true">
<label>Data1: </label>
</range>
...
</body>
Note that the bind says it's an integer but the default and the start/end/step are all decimals.
For a simple numerical widget, what happens when the bind type is integer
and the default is a decimal?
@lognaturel to answer your question it's not a problem if we use type="xs:integer"
and then decimals as I use intValue() method so I get ints.
Issue by mitchellsundt Thursday Jul 09, 2015 at 19:28 GMT Originally opened as https://github.com/opendatakit/opendatakit/issues/877 (2 comment(s))
Originally reported on Google Code with ID 876
Reported by
james.beard.tz
on 2013-07-21 03:04:43