diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index 9fb3bf6ee..e2c42e6a5 100644 --- a/src/core/xfa/template.js +++ b/src/core/xfa/template.js @@ -503,6 +503,10 @@ class Area extends XFAObject { return true; } + [$isBindable]() { + return true; + } + [$addHTML](html, bbox) { const [x, y, w, h] = bbox; this[$extra].width = Math.max(this[$extra].width, x + w); @@ -2869,6 +2873,11 @@ class Field extends XFAObject { } if (value) { + if (this.ui.numericEdit) { + value = parseFloat(value); + value = isNaN(value) ? "" : value.toString(); + } + if (ui.children[0].name === "textarea") { ui.children[0].attributes.textContent = value; } else { @@ -5166,6 +5175,10 @@ class SubformSet extends XFAObject { } return parent; } + + [$isBindable]() { + return true; + } } class SubjectDN extends ContentObject { diff --git a/test/unit/xfa_parser_spec.js b/test/unit/xfa_parser_spec.js index 3f04586c8..8ef286822 100644 --- a/test/unit/xfa_parser_spec.js +++ b/test/unit/xfa_parser_spec.js @@ -1400,4 +1400,30 @@ describe("XFAParser", function () { ).toEqual(["a", "b", "c", "d", "e"]); }); }); + + it("should make a binding with a element in an area", function () { + const xml = ` + + + + + + foobar + + + + `; + const root = new XFAParser().parse(xml); + const form = new Binder(root).bind(); + + expect(searchNode(form, form, "A..B..text")[0][$dump]().$content).toBe( + "foobar" + ); + }); });