How do I add a click action on a button that jumps to a different page, and sets focus on that page

todd drake shared this question 5 years ago
Answered

How do I add a button click action that does two steps?


Step 1, go to another page.


Step 2, set focus on an element on the page invoked in step 1.

Comments (6)

photo
1

On first page create the navigation action to the second screen.


On the second screen select the 'onPageLoad' trigger and create the setFocus action.

photo
1

Thanks Carles. The only issue with that specific approach is the page I am jumping to is my home page and I am needing to scroll down to a spot below the header.


But, your idea has put me on the right track. I thought of making a duplicate of my home page and then jump to that page instead and do as you suggested to invoke the focus function to scroll down on page load.


I tried it this morning and it works great. Many thanks!!

photo
1

Excellent!

photo
1

How do you do this same thing with a dynamic panel. Example: I have radio buttons that set different active panels for the different payment methods. Is there a way I can have the whole page scroll down because the dynamic panel is below the fold and I want to bring it into view for the user.

photo
1

Hi Justin,


Say you have 2 radio buttons and a dynamic panel that has 2 panels. On the first radio button, add an event that when clicked, the screen focuses on the dynamic panel. Meanwhile, on the second radio button, add an event that when clicked, set the second panel as the active panel. Also, on the same event, set the focus on the dynamic panel.

photo
1

Never mind. Because I'm using a dynamic panel it's not page load. I need to do On Click make it set the focus.