Highlighted

Problem with databinding

Piotr_Stapp

08-10-2008

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.

Replies

Highlighted

pguerett

09-10-2008

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.