wsharba / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 1 forks source link

Non-relevant defaults are discarded on save #999

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Enter something for enumerator the first page
Swipe to go second page
Do not answer anything for the select
Exit and save the form
Reopen saved form
Go to second page
Select Yes for the select
Add a group when asked
Swipe to the third page
The SingleLine0 prompt is not present

This happens in Collect 1039. 

Reported by gnappa156@gmail.com

Original issue reported on code.google.com by yano...@nafundi.com on 8 May 2014 at 4:37

Attachments:

GoogleCodeExporter commented 9 years ago
I believe the reason for this is behavior is that SingleLine0 is (and the group 
that it's in are) not relevant unless RadioButton_5 is yes. So when you save 
the form with RadioButton_5 as blank, JavaROSA throws away any default values 
you've stored in SingleLine0 because those values are not relevant. When you 
re-load the form, it loads that instance with SingleLine0 thrown away and shows 
you that.

I think JavaROSA is doing what it was designed to do. It's not a bug, per se, 
but it is dangerous behavior that we should probably change. No idea how hard 
it'll be to fix, but in the meantime, if you want something to stick around 
when you save, you have to make it relevant. 

So in this case if you want the default value of SingleLine0 to stick around, 
you need to make it relevant regardless of what is selected in RadioButton_5.

Original comment by yano...@nafundi.com on 8 May 2014 at 4:37