Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

form instance focus

Avatar

Avatar
Validate 1
Level 1
PHBx1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
PHBx1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
PHBx1
Level 1

13-10-2016

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

17-10-2016

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

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
Level 1
PHBx1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
PHBx1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
PHBx1
Level 1

18-10-2016

Perfect, thank you.

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

13 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

13 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

13-10-2016

I've moved your question to the LiveCycle Designer forum, where you're more likely to get an answer relevant to your situation.

Avatar

Avatar
Validate 1
Level 1
PHBx1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
PHBx1
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
PHBx1
Level 1

13-10-2016

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!

Avatar

Avatar
Boost 5
Level 4
George_Johnson
Level 4

Likes

21 likes

Total Posts

234 posts

Correct Reply

27 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 4
George_Johnson
Level 4

Likes

21 likes

Total Posts

234 posts

Correct Reply

27 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
George_Johnson
Level 4

13-10-2016

You can also set the document's pageNum property to display the newly created page.

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

13 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

13 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

13-10-2016

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.