cancel
Showing results for 
Search instead for 
Did you mean: 

How to get NodeName for given attribute

Former Member
0 Kudos

Hi

i am passing AttributeName to a method.I want to get the NodeName to which this attribute belongs to.

I am getting attributeInfo object for given attributeName:

<b>IWDAttributeInfo attinfo = wdContext.getNodeInfo().getAttribute(strAttributeName);</b>

From This i want to get NodeName it belongs.Please help.

I tried with attinfo.getNode().getName .This is not working as i expected.

Thanks

Prasad

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos
attInfo.getNode().getName()

should do the job. What's not working?

Armin

Former Member
0 Kudos

Hi

I have a Node called "Shifttab" under which i have attribute called "Shiftinfo".

now i am passing attribute name("Shiftinfo") to a method.

in the method i wanted to do following way

IWDAttributeInfo attinfo = wdContext.getNodeInfo().getAttribute("shiftinfo");

attinfo.getNode().getName() is not returing node name "Shifttab" as expected.

i can do this wdContext.nodeShifttab().setShiftinfo("10");

but i wated to do dynamically.Please help

Thanks

Prasad

Former Member
0 Kudos

try

wdContext.getChildNode("Shifttab",0).getNodeInfo().getAttribute("Shiftinfo");

Regards,Anilkumar

monalisa_biswal
Contributor
0 Kudos

U are creating attribute under node "Shifttab", but while accessing the attribute info u are accessing it from the root node.So the getAttribute method itself must be failing.Instead of passing attribute name pass attribute info as a parameter to your method.

Former Member
0 Kudos

Hi,

This one worked for me. Try this.

IWDAttributeInfo a=wdContext.nodeShifttab().getNodeInfo().getAttribute(IPrivate<View>.IShifttabElement.SHIFTINFO);

wdComponentAPI.getMessageManager().reportSuccess("Node name is "+a.getNode().getName());

Regards

Fahad Hamsa