cancel
Showing results for 
Search instead for 
Did you mean: 

how to made wdContext generic?

Former Member
0 Kudos

Hello,

As far as I know, wdContext is tied to the class that uses it. Like for example,

IPrivateTest1View.IContextNode wdContext;

How do I create a utility class that acceps a generic context, and evaluates the type of context that was pass?

Probably something like:

public void evaluate ( Object context) {

if (context instanceof IPrivateTest1View) {

//do something

}

Is this even possible? since the wdContext can have methods like currentElement based only on its declared context, which can differ on different wdContext's.

regards,

arnold

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For generic access to context, use the IWDNode, IWDNodeElement, IWDNodeInfo etc. interfaces from progmodel.api.

Armin

Former Member
0 Kudos

Hello Armin,

Thank you for the reply. I am after the generic access of wdContext, not context. Do you happen to know how?

regards,

arnold

Former Member
0 Kudos

Hi,

Have you tried this

private void a(IWDNode node)

{

}

invooking the above one

a(wdContext);

Regards

Ayyapparaj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can try to create a method as follows

private void a(DataNode node)

{

}

call it as

a(wdContext);

Your import should contain

import com.sap.tc.webdynpro.progmodel.context.DataNode;

Regards

Ayyapparaj

Former Member
0 Kudos

Hello Ayyapparaj,

Thanks for the reply. My libraries doesn't seem to have DataNode. It does have DataNodeInfo. Is this the correct one?

regards,

arnold

Former Member
0 Kudos

Hi,

To get the nodeinfo use

IWDNodeInfo nodeInfo = node.getNodeInfo();

based on the above code you have the node.

Regards

Ayyapparaj

Former Member
0 Kudos

Hello Ayyapparaj,

I don't have the following code you mentioned on your previous post, the DataNode. It seems the library is not in my development environment. Is it a previous library? I'm using 2004s SR2.

regards,

arnold

Former Member
0 Kudos

Hi,

It seems to be part of sap.comtcwdapigci.jar

Regards

Ayyapparaj

Former Member
0 Kudos

Hello Ayyapparaj,

Is that an extra library? I don't seem to have the jar file that you mentioned. I did a search on my drive, it resulted none.

regards,

arnold