cancel
Showing results for 
Search instead for 
Did you mean: 

how to access node in context

Former Member
0 Kudos

Hello,

lets say in view I have a model node i.e zport which has one model attribude How I will access this model attribute ?

i am trying something like:

wdContext.nodePort().....

Pls any suggestions ?

Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Can you post the exact context structure?

Generally you access an attribute value via an element of its node, like

wdContext.node<Node>().get<Node>ElementAt(index).get<Attribute>();

Armin

Former Member
0 Kudos

How I can get to know the index ?

I mean its one modelnode, then inside this model node there is one node and two model attribudes.....

Regards,

Former Member
0 Kudos

Post the exact context structure.

Armin

Former Member
0 Kudos

As I mentiond :

the root model node is Zport

This Zport has i model attribue i.e output and two model attribudes i.e Tabname and Uname

and I need to access the uname ?

What else you need to know to help me ? ( I guess its the context str or what do u exactly mean by context str ) ?

Regards,

Former Member
0 Kudos

Cardinalities, singleton etc.

Armin

Former Member
0 Kudos

Hi Shah,

I think your structure is like this

zport(Node)

output(subnode of zport)

tabname(attribute of output node)

uname(attribute of output node)

if this is your structure then you can access the value of uname like this:

wdContext.nodezport().nodeoutput().currentOutputElement().getUname();

This will get you the current element inside the output node

But if you want a particular element from your node then

for(int i=0;wdContext.nodezport().nodeOutput().size();i++)

{

if<condition as per your business requirement>

{

wdContext.nodezport().nodeOutput().getOutputElementAt(i).getUname();

}

}

Regards,

Murtuza

Former Member
0 Kudos

Thanks Murtuza for your help

Regards,