diff --git a/src/core/xfa/bind.js b/src/core/xfa/bind.js index 991be7060..c58f6d772 100644 --- a/src/core/xfa/bind.js +++ b/src/core/xfa/bind.js @@ -616,6 +616,8 @@ class Binder { dataNode[$appendChild](match); // Don't bind the value in newly created node because it's empty. + this._setProperties(child, match); + this._bindItems(child, match); this._bindElement(child, match); continue; } diff --git a/test/unit/xfa_parser_spec.js b/test/unit/xfa_parser_spec.js index a3736a383..3f04586c8 100644 --- a/test/unit/xfa_parser_spec.js +++ b/test/unit/xfa_parser_spec.js @@ -1354,5 +1354,50 @@ describe("XFAParser", function () { expect(searchNode(data, data, "root")[0][$dump]()).toEqual(expected); }); + + it("should make a binding with a bindItems", function () { + const xml = ` + + + + + + 1 + 2 + 3 + 4 + 5 + + + + + + + `; + const root = new XFAParser().parse(xml); + const form = new Binder(root).bind(); + + expect( + searchNode(form, form, "A.B.C.items[0].text[*]").map( + x => x[$dump]().$content + ) + ).toEqual(["1", "2", "3", "4", "5"]); + expect( + searchNode(form, form, "A.B.C.items[1].text[*]").map( + x => x[$dump]().$content + ) + ).toEqual(["a", "b", "c", "d", "e"]); + }); }); });