on 12-14-2010 2:33 PM
Hi,
I am working on webdynpro tree, it has 4 levels using recursive node .I am able to successfully create the tree.
But I am unable to find the value that the user is selecting .
Please let me know the way to read a webdynpro tree.
Regards
Tiny
Hi,
I hope you are using Tree UI to build the tree. If so the TreeNodeType added to the Tree UI has "onAction" event defined.
You can access the currently selected value, in this method. Follow the below steps
1. Create an onAction event handler for the TreeNodeType
2. While creating this event handler add an input parameter called "selectedElement" of type IWDNodeElement
3. Add the below mentioned code in the wdDoModify() method
if(firstTime){
IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNodeType");
treeNode.mappingOfOnAction().addSourceMapping("path", "selectedElement");
}
4.In the event handler created add the below code
IPrivate<VeiwName>.I<RootNodeElement> element = (IPrivate<VeiwName>.I<RootNodeElement>) selectedElement;
String selectedValue = element.getVa_Value();
Assuming Va_Value is the attribute under the RootNode.
Also access this link for more info
[http://help.sap.com/saphelp_nw70/helpdata/en/c0/088b41b4b3b25fe10000000a1550b0/frameset.htm]
Regards,
Vishweshwara P.K.M
Edited by: Vishweshwara P.K.M on Dec 14, 2010 4:36 PM
Edited by: Vishweshwara P.K.M on Dec 14, 2010 4:38 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Its very much possible to track down the child nodes, but getting the parent node is not possible. You can get the name(or value) of the parent element by maintaining an attribute called ParentName under the Rootnode and populating it with the parent name every time you create an element.
To get the Child nodes use the below code in the "onAction" event handler created (as explained in the above thread),
IPrivate<ViewName>.I<RootElement> childElement = null;
int noOfchild = element.nodeVn_ChildStructure().size();
for (int i = 0; i < noOfchild; i++) {
childElement = element.getVn_ChildStructureElementAt(i);
String childName = childElement.getVa_Value();
wdComponentAPI.getMessageManager().reportSuccess("Child Name is: "+childName);
}
assuming "Vn_ChildStructure" is the name of the recursion node placed under the root node.
Regards,
Vishweshwara P.K.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.