add support for open select one in prompts
It appears that javarosa will accept any answer to a select1 question, even those not in the specified list (imagine a non-standard select UI). The answer will be there when you navigate and will also be there in the instance when you save the form.
However, it also appears that javarosa silently discards any answer not in the list when loading the form (the answer could come from a specified default value or from a loaded instance).
This behavior seems a little inconsistent to me. That is, either saving values not in the list should be disallowed, or values not in the list should not be discarded (especially not silently) when loading a new form.
The reason this came up is we had a student here try to develop an autocomplete widget, and he had the idea to use the select1 labels as appropriate values to autocomplete. However, since it's a text box, people can theoretically type anything unless we constrain it appropriately. So those values not in the list would disappear when loading a saved instance.
Having thought about this a bit I think it makes a little more sense to allow any values, and not discard them at load. It would enable things like "Other__" fields or other random interfaces using the appearance attribute, and a user could still specify a constraint if they'd like to ensure a standard 'select1' behavior.
- A select1 constrained to contain a single item from its list of items.
- An unconstrained select1. I might not call this a select1 anymore, I might call it a string input with items list.
This is supported in the XForms specification for select1 controls through the use of the selection="open" attribute, which we currently don't support. We could definitely add that into the core, though.
Definitely agreed that the current system is inconsistent. I believe that in-spec the behavior is that unless selection="open" is true, the control should throw an exception when it is loaded with an inconsistent value. Is that the behavior we want to support?"