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

Bug in getAllFieldNames() in FormBridge's ContainerFoundation_JS code

Avatar

Avatar
Level 1
BrianS36
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
BrianS36
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
BrianS36
Level 1

04-05-2012

The JavaScript created by LiveCycle Designer ES 8.2.1 when a FormBridge object is inserted and the ContainerFoundation_JS script object is created has a bug in it. The function getAllFieldNames() does not return all the fields when there is more than one page.

function getAllFieldNames() {
     var fieldSOMs = new Array();
     for (var page=0; page        var fields = xfa.layout.pageContent(page, "field");
        for (var i=0; i            var som = fields.item(i).somExpression;
            som = som.replace(/\[0\]/g, "");
            som = som.replace(/xfa.form./g, "");
            som = som.replace(/#subform./g, "");
            // fieldSOMs[i] = som; // Bug. On second page i goes back to zero.
            fieldSOMs.push(som); // Fix. Use push()
        }
    }
    return fieldSOMs;
}

Replies

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct Reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct Reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

06-05-2012

Your script isn't working because is incomplete. The two for-loops aren't declared correctly.

Here's another script, the will do the same job.