In my attached form I collect info and then at the bottom I have a button to add the next disclosure, this creates a new subform on the next page.?I would like (if possible) to be able to automatically move to the top of the next page when the ''Next Disclosure''?button is clicked.?Is this possible?
Thanks for the help.
Automatically move to top of next pageSelect the page1 form and on the properties -%26gt; pagination -%26gt; place select ''on top of page 1''
Automatically move to top of next pageThat did not work.?The next page is added but I still have to scroll to see it.?Is there a way to have the next page automatically scrolled into position without the user having to scroll down to see it?
Yes, you can use the setFocus (on the new instance) method after you add the new instance to the form.
Can you give me an example of using setFocus??I tried xfa.host.setFocus(''CompanyName'') and that puts the focus on the first page not the next page.?When I changed it to ..(''CompanyName[1]'') that didn't work.
Thanks again for the help.
This has worked for me:
// jump to next page
xfa.host.pageDown();
//optional - alert the user
app.alert(''You have jumped to the newly added Treatment page'')
I use a similar command and it work.
xfa.host.setFocus(xfa.resolveNode(''CompanyName[''+(CompanyName.instanceManager.co unt-1)+''].CHOOSE_A_FIELD_TO_SET_FOCUS''));
I haven't tested this on your form, but it should work. Just one not, your javascript must run on client.
The setFocus command is the command to use but your objects do not exist until the script is finished. The only way I have found to do this is by using an Acroform command to execute another command in the future.
Here is the command:
var
setField = app.setTimeOut(''this.getField('form1[0].#subform[0].TextField1[0]').setFocus(); '',1);
Paul,
If you put the setFocus command on the Initialize event of the object (the one thats added) woun't it only be invoked after the creation of the object is finished?
Thank you guys for the wonderful tips but I'm just not getting it to work.?Can you post an example that works so that I can see what I'm supposed to do?
Jay
See if it helps.
Rui,
That worked, thank you so much!?Thanks to Paul and malaki as well.?I'm posting the form if anyone else wants to see the code, it's under the ''Next Disclosure'' button.
Thanks again!
Jay
No comments:
Post a Comment