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.

Problem with databinding

Avatar

Level 2
I have an XML with structure like this:






I would like to create a Table in XFA. I bind TextField in row to $.field.atr[*]. This is working fine. But I do not know how to set optional attribute "art". I was trying using:
a) xfa.data.resolveNode("root.field[1].art").value
b) xfa.data.resolveNode("root.field[1]").setAttribute('art','value');
c) Instead of xfa.data I used xfa.data.datasets
d) and something more
But any of this does not work. What am I doing wrong?
Thanks for any help.
1 Reply

Avatar

Former Community Member
The attributes will become nodes (with an @sign at the beginning) in the dom structure .....so you should be able to use $.field.atr[*].@art



If you create a large multi line field you can dump the data dom into that field to see its structure.



TextField.rawValue = xfa.datasets.data.saveXML("pretty").



This is only for debugging ...once you figure it out remove the field.