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

Service response must ensure that main model recalculates #4178

Closed
ebruchez opened this issue Sep 11, 2019 · 1 comment
Closed

Service response must ensure that main model recalculates #4178

ebruchez opened this issue Sep 11, 2019 · 1 comment

Comments

@ebruchez
Copy link
Collaborator

@ebruchez ebruchez commented Sep 11, 2019

As things stand, we don't have cross-model dependencies in our XForms engine.

If a service runs (in particular "after the controls are ready"), the service response is stored into a separate fr-actions-model. A change there doesn't cause fr-form-model to be marked for recalculation. So far so good, and this is usually ok because that means that the service response did not make changes to fr-form-model.

However, certain users have a separate custom model which feeds from the service response directly upon xforms-submit-done. This too doesn't cause fr-form-model to update. And if a calculation depends on an instance in that separate model, then the UI will refresh but not fr-form-model, and so the UI will in effect be out of date.

Ideally, this shouldn't be done, and the user should use a dataset. But we can address this by forcing this upon a service response:

<xf:recalculate model="fr-form-model" xxf:deferred="true"/>

This will not cause an immediate refresh but will make sure the main model recalculates before the next refresh even if there are no other action responses such as setting control values. In general, there will be, and there will be a recalculate/refresh anyway, so the performance is typically not impacted.

+1 from customer

@ebruchez ebruchez self-assigned this Sep 11, 2019
@ebruchez ebruchez added this to To review in Orbeon Forms 2019.1 via automation Sep 11, 2019
@ebruchez ebruchez added this to To do in Orbeon Forms 2018.2.4 via automation Sep 11, 2019
ebruchez added a commit that referenced this issue Sep 12, 2019
@ebruchez ebruchez closed this in 4b72bc7 Sep 12, 2019
Orbeon Forms 2019.1 automation moved this from To review to Done Sep 12, 2019
Orbeon Forms 2018.2.4 automation moved this from To do to Done Sep 12, 2019
@ebruchez

This comment has been minimized.

Copy link
Collaborator Author

@ebruchez ebruchez commented Sep 16, 2019

Possible +1 from customer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1 participant
You can’t perform that action at this time.