Often with forms we need to collect information for a number of applicants or a number of people. It would be easy enough to build a separate page for each applicant, and repeat the form items we need to collect the desired information for each applicant. But this might lead to a very large form that starts to perform poorly if it gets too large.
One way to address this is to build the form with only one page, but provide controls on the page, such that the user can choose which applicant to show on that page. Using XForms, this is actually pretty easy to do. This is called page scrolling. A similar approach is used with record scrolling (only showing a subset of records in a table at a time - as opposed to showing all the records in the table). Record scrolling is now made easy with the new IBM Forms 4.0 Designer, where it's now part of the table wizard.
To explain how page scrolling works, we'll work with a formData instance that looks like:
<xforms:instance id="formData" xmlns="">
Page scrolling is achieved by having a pane on the page, that has a ref with a predicate. something like:
instance('formData')/applicants/applicant[position() = ../../currentApplicant]
Which simply means, find the applicant that is in the position equal to the element currentApplicant
So if currentApplicant contains 1, then it'll find the first applicant. if currentApplicaiton contains 4, it'll find the 4th applicant
Then inside the pane we place xforms items with a relative path (so just name - not instance('formData')/applicants/applicant/name)
Then if we provide controls on the form page, that manipulate the currentApplicant (like increasing or decreasing the value), and insert or delete new nodes, then the single page form can behave like a many page form. So instead of navigating from page to page, we're simply changing the index (ie currentApplicant) of which row the page is presenting.
The only drawback to this approach is that is does not print very well. It will only print the current applicant. But wizard pages are not normally printed, so it's still a good approach. For those that do need to print, there is a way to dynamically generate pages at printing time, which is posted here: Printing a Page Scrolling Form Sample.