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

New property to control if the wizard validates on page change #6647

Open
avernet opened this issue Nov 25, 2024 · 1 comment
Open

New property to control if the wizard validates on page change #6647

avernet opened this issue Nov 25, 2024 · 1 comment

Comments

@avernet
Copy link
Collaborator

avernet commented Nov 25, 2024

<property
    as="xs:string"
    name="oxf.xforms.xbl.fr.wizard.visit-on-page-change.*.*"
    value="always (default) | never | only-forward"/>

A value of never is most appropriate when using free validation, while only-forward is most appropriate with lax validation. While we could support an only-backward token, there are no clear use cases for it.

This feature relates to #6631 but differs in its approach. While both prevent showing invalid fields during page navigation, this implementation selectively disables marking controls as "visited" during page changes rather than disabling live validation entirely.

Implementation notes:

  • All relevant code is in wizard.xbl
  • Use fr:component-param-value() to access the property value from XForms (not needed at XSLT level)
  • For fr-next-internal, we call fr-wizard-visit-all-to-current, but not for fr-prev-internal
  • During backward navigation, controls on the current page are marked as visited via xxf:setvisited on xforms-deselect. This should be skipped when the property is never or only-forward
  • In fr-wizard-visit-all-to-current (called only during forward navigation), add a condition to skip execution if the property value is never

+1 from customer

@avernet
Copy link
Collaborator Author

avernet commented Nov 29, 2024

Tentatively implemented support for the visit-on-page-change property as described below:

  • always: The default setting, maintained for backward compatibility.
  • never: Disables visiting the controls during page navigation.
  • only-forward: Visits the control only when navigating forward, not when navigating backward.
<property
    as="xs:string"
    name="oxf.xforms.xbl.fr.wizard.visit-on-page-change.*.*"
    value="always"/>

When setting the above property to never or only-forward for a given form, it is advisable to disable the initial focus for that form. Otherwise, errors will still appear for the first field when it loses focus during page navigation.

<property as="xs:boolean" 
    name="oxf.fr.detail.initial-focus.*.*" 
    value="false"/>
  • Add a setting to the Form Settings dialog in the Form Builder.
  • Test the behavior with subsection navigation.

avernet added a commit that referenced this issue Nov 29, 2024
@ebruchez ebruchez moved this to In progress in Orbeon Forms 2024.1 Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

1 participant