Javascript: get subform objects in a subform

davids88333804

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)

Kosta_Prokopiu1

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)