how to create an attribute
hi,
i can create xml elements in designer, e.g. john brinkman's example
// add question datagroup right question type
// add question subform bind against it.
var vnewq = xfa.datasets.createnode("datagroup", "question");
vnewtype = xfa.datasets.createnode("datavalue", "questiontype");
vnewtype.value = vqdef.questiontype.value;
vnewq.nodes.append(vnewtype);
vsection.datanode.nodes.append(vnewq);
however, create attribute (i'm working existing predefined schema) can't seem find simple way, e.g.
i like
<question questiontype=""/>
how can this? tried loading xml in like
var vnewtype =
<question questiontype="">
</question>;
xfa.data.mform.loadxml(vnewtype.tostring(), false, false);
but unless give child node, bombs out. work
var vnewtype =
<question questiontype="">
<dummyrow/>
</question>;
any worth 5 gold medals.
hi,
you need set contains property of datavalue 'metadata" turn attribute, can once datavalue has parent, code should like;
var vnewq = xfa.datasets.createnode("datagroup", "question");
vnewtype = xfa.datasets.createnode("datavalue", "questiontype");
vnewtype.value = vqdef.questiontype.value;
vnewq.nodes.append(vnewtype);
vnewtype.contains = "metadata";
vsection.datanode.nodes.append(vnewq);
regards
bruce
More discussions in LiveCycle Designer
adobe
Comments
Post a Comment