Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test on behavior when existing instance is opened for edit #813

Open
lognaturel opened this issue Jan 22, 2025 · 2 comments
Open

Add test on behavior when existing instance is opened for edit #813

lognaturel opened this issue Jan 22, 2025 · 2 comments

Comments

@lognaturel
Copy link
Member

Static defaults from the form definition get used for nodes that are omitted from the existing instance.

edit_defaults.xlsx

@lognaturel
Copy link
Member Author

lognaturel commented Feb 10, 2025

To support this, let's add Scenario method to load an existing instance. This could be an overload of init or something like initWithInstance. The instance will be passed in as an XFormsElement.

@seadowg
Copy link
Member

seadowg commented Feb 11, 2025

From Slack:

And on testing and responsibilities with editing when it comes to JavaRosa and Scenario: that's bad right now IMO. Collect does way more than I'd expect to "attach" the existing instance when loading a form: https://github.com/getodk/collect/blob/0b52f5115e04b5ef4857ec1e1d58b2a5265e0888/co[…]src/main/java/org/odk/collect/android/tasks/FormLoaderTask.java

To me it feels like JavaRosa could expose a nice way to parse the instance XML into a FormInstance and then there should be an easy path to intializing form entry with a FormDef and that FormInstance. JavaRosa's FormDef is basically both the form "engine" and the immutable definition of the form at the same time though so there's a lot of tangling going on.

To summarize my own thoughts, there's more than just testing here: we need to actually support editing as a feature in JavaRosa. I'd suggest closing this for the moment and waiting to engage with the idea again when we finally get rid of FormLoaderTask in Collect (maybe for getodk/collect#6023).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants