Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Bug in getAllFieldNames() in FormBridge's ContainerFoundation_JS code

Avatar

Level 1

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;
}

1 Reply

Avatar

Level 10

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.