Skip to main content


 

Symptoms


I have a large form that has views that are over the size of the screen. I have the requirement to on certain questions contained within a view you skip to section B, or skip to section C. In this case I have a rule that is collapsing the current view and navigating to the 'section B' or 'section C' view based on the data input.

What happens when the user interacts with the form is the view is navigated to is the view opens in the centre of the view, as the view heigh is greater than the screen height the user needs to then scroll up to the top of the view to start entering data.

Is there any way I can force the view to open and navigate to the top of the view?
 

Diagnoses


Can be done by injecting javascript.
 

Resolution

Place a hidden data label at the top of the form.
Set the data label to a literal.

When you want it to scroll, to a transfer event and send this to the data label:
<script>window.scrollTo(0, 0)</script>

If you want to use it more than once, then do an empty transfer to the datalabel after your transfer data rule. It refreshes the datalabel so the code will fire again.




 
Be the first to reply!

Reply