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

Describe and document which expressions are evaluated when #516

Open
ggalmazor opened this issue Dec 13, 2019 · 6 comments
Open

Describe and document which expressions are evaluated when #516

ggalmazor opened this issue Dec 13, 2019 · 6 comments

Comments

@ggalmazor
Copy link
Contributor

During #515, we detected a special scenario where a group's relevance might make some field calculations not be evaluated. See Safe2014DagImplTest.verify_relation_between_calculate_expressions_and_relevancy_conditions() for context.

We should discuss this and:

  • Decide if we should evaluate all expressions regardless of relevance or not, considering the performance implications.
  • In any case, describe and document how all this works. Specify which expressions get evaluated when and under which circumstances.
@ggalmazor
Copy link
Contributor Author

@lognaturel affirms that "I believe Gareth had found something in the XForms spec that suggested that expressions should be evaluated regardless of relevance. This has performance implications, certainly.". @tiritea, could you provide more info regarding this?

@tiritea
Copy link
Contributor

tiritea commented Dec 19, 2019

found it, in https://www.w3.org/TR/2012/WD-xforms20-20120807/: [emphasis added]

6.1.4 The relevant Property

Description: indicates whether the model item is currently relevant. Instance data nodes with this property evaluating to false are unavailable in the user interface ...

note emphasis that is about visibility in UI...

And later:

Elements other than form controls may also use a Single Item Binding that selects a non-relevant node, but such elements are not made unavailable or non-operable due to the Single Item Binding because it is not a UI binding expression...

Which I interpret to mean calculations - as a non-UI element - are specifically not disabled (ie are "not made non-operable") as a consequence of their immediate (or inherited) relevance evaluating to false. More specifically, calculations in non-relevant groups are still to be evaluated.

@ggalmazor
Copy link
Contributor Author

Thanks, @tiritea. I think you're right and we should always compute calculates. It's clear to me now that the relevance of a field is a UI concern. What do you think, @lognaturel?

If we all agree on this, we should raise an issue and review this accordingly, starting from describing different regression scenarios and creating tests for them.

@tiritea
Copy link
Contributor

tiritea commented Dec 20, 2019

FYI adding this as it appears 'relevant' to discussion (no pun intended... ;-) :

#284

@tiritea
Copy link
Contributor

tiritea commented Dec 20, 2019

Btw, the practical benefit of always performing calculations irrespective of relevance is that it permits processing lists using repeat groups, but ‘hiding’ the repeat group from the UI so the user doesn’t have to nav thru it; eg my geofence or geotrace-2-KML forms.

@ggalmazor
Copy link
Contributor Author

Thanks for taking the time to add info, @tiritea!

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

No branches or pull requests

2 participants