I have a simple form with two pages one text field on each page. The first page has a button that adds another instance of it to the document. When the button is pressed another page is added but the focus stays on the same page.
I'm looking for the code syntax that will allow me to set focus to the newest(last) instance of the added page.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
In Designer you will need to use xfa.host.setFocus() to set focus.
So, something like;
var newPage = this.resolveNode('form1._Pg2').addInstance(1);
xfa.host.setFocus(newPage.F1.somExpression);
Regards
Bruce
Views
Replies
Total Likes
Assuming you're doing it by spawning a template you can derive the name of the field in the spawned page (it has a fixed structure, composing of the template name, the page number and the original field name) and then use the setFocus method to switch to it.
Views
Replies
Total Likes
You can also set the document's pageNum property to display the newly created page.
Views
Replies
Total Likes
I'm adding this page through a button click:
this.resolveNode('form1._Pg2').addInstance(1);
So assuming I'm on the first page, and click add page, and I want to go to the first text field on the second page, the structure of the command would be like this?
I'm unclear how to address the second page. (very new to this)
form1._Pg2(2).F1.setfocus
Thanks In advance!
Views
Replies
Total Likes
I've moved your question to the LiveCycle Designer forum, where you're more likely to get an answer relevant to your situation.
Views
Replies
Total Likes
Hi,
In Designer you will need to use xfa.host.setFocus() to set focus.
So, something like;
var newPage = this.resolveNode('form1._Pg2').addInstance(1);
xfa.host.setFocus(newPage.F1.somExpression);
Regards
Bruce
Views
Replies
Total Likes
Perfect, thank you.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies