cancel
Showing results for 
Search instead for 
Did you mean: 

How to manipulate recursive node with context api?

Former Member
0 Kudos

Hi, all.

I made a recursive node in my context. So it is like a tree.

When I choosed one child node in my tree, how can I get it`s current element?

Thanks a lot.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi, all.

I think that I have to do something in wdDoModifyView method.

The following codes are from the tutorial:

treeNode.mappingOfOnAction().addSourceMapping("path", "selectedElement");

I know that "selectedElement" is the input parameter name of my action method, but I have no idea what is "path"?

Can anyone do me a favor.

Thx.

Former Member
Former Member
0 Kudos

Hi, Tulasi.

I can`t use your link. Can u post a correct one or teach me how to use yours. Thx.

Former Member
0 Kudos

PATH is a constant representing the "path" in the recursive node.

Former Member
0 Kudos

"path" is the name of the event parameter. You can also use the parameter "nodeElement" instead. The parameter mapping can and should be done at design-time (if available in your release). To do so, right-click the TreeNodeType instance in the Outline view and select "Parameter Mapping". In the dialog you can map event parameters to action parameters using drag-and-drop.

Armin

Former Member
0 Kudos

Hi Louis

Sorry for pointing to the wrong link

In Short:you have to add and map the path(of type String) for the event handler

In Sap Help clearly explains about the tree example please look into it.

http://help.sap.com/saphelp_nw70/helpdata/en/b2/8f5640f5f60272e10000000a155106/content.htm

or

Go to NWDS help Doc just serach for treenodeAPI.You will get complete example to handle this.

Thanks

Tulasi

Former Member
0 Kudos

Hi, Tulasi.

These are my codes in wdDoModifyView.

if(firstTime)

{

IWDTreeNodeType treenode = (IWDTreeNodeType)view.getElement("TreeNodeType");

treenode.mappingOfOnAction().addSourceMapping("path","select_element");

}

It`s very simple, but I got error when I executed my app.

I thought that I didn`t map the para correctly.

Edited by: Louis HUANG on Jul 28, 2009 4:26 AM

Former Member
0 Kudos

Hi, Armin.

I couldn`t use your way to do Parameter Mapping. When I right clicked my mouse, I didn`t see the option "Parameter Mapping".

My NWDS is 7.0.

Thx for your help.

monalisa_biswal
Contributor
0 Kudos

hi Louis,

selected_element should be of type IWDNodeElement.

Add this parameter to your event handler method.

Hope this helps!

Monalisa

PradeepBondla
Active Contributor
0 Kudos

Hi,

Could you please share the issue and solution

Thanks,

PradeeP

Former Member
0 Kudos

Hi Louis

Check out this link

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/47ce9b90-0201-0010-59b5-f70...

Check this thread also

Thanks

Tulasi Palnati

Former Member
0 Kudos

Hi,

Use this code,

if(firstTime)

{

IWDTreeNodeType treenode = (IWDTreeNodeType)view.getElement("TreeNodeType");

treenode.mappingOfOnAction().addSourceMapping("path","select_element");

}

Regards,

Sunaina Reddy