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

xfa.layout.pageContent return spanned object twice

arvindkumar7
Level 3
Level 3

Hi guys,

I am try to get tables with xfa.layout.pageContent(i, "subform"). This works well but when a table that spans multiple pages comes,  that table is returned twice.

First time table is returned for say page 4 and when loop comes to next page 5 same table is returned again.

Can anyone please help, how to get table only once even if it spans many pages.

Thanks

Arvind

1 Reply
_Bruce_Robertson
Level 10
Level 10

Hi Arvind,

You could use xfa.layout.page(...); which returns the first page the object appears on, so if this doesn't equal i then ignore.

You could also avoid the layout methods and just process the form model;

function processTables(node)

{

    if (node.className == "exclGroup" ||

        node.className == "subform"  ||

        node.className == "subformSet" ||

        node.className == "area")

    {

        for (var i = 0; i < node.nodes.length; i++)

        {

            var childNode = node.nodes.item(i);

            if (childNode.className == "subform" && childNode.layout == "table")

            {

                // ... do table stuff ... //

                console.println(childNode.somExpression);

            }        
            processTables(childNode);

        }

    }

}

processTables(form1);

You might need to change form1 to match the name used in your form.

Regards

Bruce