on 01-11-2010 2:16 PM
Hi All
Currently i am able to retrieve the currently selected node value thru the recursive method as below the code, once i retrieve the currently selected element node value then how to retrieve the immediate parent of the currently selected element.
if any body have the sample code to retrieve the parent node value from currently selected Tree element in a Tree UI element.
The Code i am using currently using to retrieve the currently selected node value from the Tree UI element, but i need sample how to retrieve the parent node value from the currently selected node element, any inputs on the same would be great help to me
public com.sap.tc.webdynpro.progmodel.context.MappedNodeElement getCurrentSelection( com.sap.tc.webdynpro.progmodel.context.MappedNodeElement serviceElement ) {
//@@begin getCurrentSelection()
IPrivateBhq2c_MaintainServiceStrucView.IVn_ServicesOnScreenElement eleChild = null;
if(serviceElement!=null)
{
eleChild = ((IPrivateBhq2c_MaintainServiceStrucView.IVn_ServicesOnScreenElement)serviceElement).nodeChildServicesNode().currentVn_ServicesOnScreenElement();
}
if (eleChild == null)
{
if(serviceElement!=null)
return serviceElement;
else
return null;
}
else
{
serviceElement = getCurrentSelection (eleChild);
}
if(serviceElement!=null)
return serviceElement;
else
return null;
//@@end
}
Thanks
Kalki reddy
To get the selected tree node (resp. the context element representing it), use IWDNode.getTreeSelection(). To get the parent tree node (resp. the context...) use IWDNode.getParentElement():
IWDNodeElement selection = wdContext.node<TreeDataSource>().getTreeSelection();
IWDNodeElement parentOfSelection = selection.node().getParentElement();
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.