Javascript: get subform objects in a subform

Avatar

Avatar
Validate 1
Level 1
davids88333804
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
davids88333804
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

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

16-07-2020

Hello!

I have the following structure:

davids88333804_0-1594907698086.png

I would like to get all the T1 and T2 object in 2 lists.

If I use the following syntax:

var myList = xfa.form.form1.Page1.Main.nodes; to get the parent subforms

I get two types of objects: _H1 ... _HN and H1 ... HN. (_H1 ... HN objects have only get access.)

Is there a nice way to get only the H1 ... HN object so I could keep working with them to get the T1, T2 child objects?

 

Thanks and best regards.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile
Kosta_Prokopiu1
Employee

16-07-2020

Hi,

the _Hx are the instance of the subform. To get all the subforms (without the _stuff) you can try this

var myList = xfa.form.form1.Page1.Main.resolveNodes("#subform[*]");
app.alert(myList.item(0).name) is H1 and length of the list is 4

 

Answers (0)