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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

Level 10
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.