OnValidate Attributes - Can't use eventObj.Source.parentNode

P

Paul Green

I have an OnValidate event implemented for a control which is bound to
an attribute.

I can get to this by the eventObj.Source property of the event.

I need to be able to traverse back up the node-hierarchy from the
attribute.

The .NET XML DOM has OwnerElement property of the XmlAttribute class,
but in the DOM available in InfoPath script it isn't.

Since the event gives me the attribute node, I don't have any way to
find this parent Element node.

Any ideas anyone?

I can't use .NET by the way - deployment issues.

Many thanks
Paul.
 
W

wp_gsa

Paul,
XDocument.View.GetContextNodes()(1) will return the element for this
attribute.
For details look up GetContextNodes Method in the Microsoft Script Editor
help.

regards, wp_gsa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top