on 10-08-2007 2:36 PM
HI,
I have a requirement to build a tree dynamically. On expanding each node I need to create sub nodes inside that. But it is always creating inside the node where the lead selection is and not inside the current expanded node. Even though I have used getTreeSelection () to get the current element.
<b>Detailed description about the application.,</b>
I have created a context with the following structure,
TreeNode (0..n)
|
|--> ChildNode (recursive SiteTree)
|--> Name (string)
I have created a Tree UI Element in the view and inserted a node type 'TreeNodeType'.
I have set the properties of the inserted node type as given bellow,
Value Attribute in TreeNode -> Name I have assigned to 'Text' property of 'TreeNodeType'.
Initially I have created four nodes in the init() method ., using the following code :
for(int i=0;i<3;i++)
{
IPrivateTestTreeView.ITreeNodeNode treenode=wdContext.nodeTreeNode();
IPrivateTestTreeView.ITreeNodeElement treeelement=wdContext.createTreeNodeElement();
treeelement.setName("Testroot:"+i);
treenode.addElement(treeelement);
}
Now I need to create sub-nodes for this dynamically.,
I have created an action and called it in 'onLoadChildren' event of 'TreeNodeType' with the following code:
public void OnCurrentSelection()
{
IPrivateTestTreeView.ITreeNodeElement el = wdContext.nodeTreeNode().getTreeSelection();
wdComponentAPI.getMessageManager().reportSuccess(el.getName());
}
<b>
Where this returns me only the name of LeadSelection node and not the node which i try to expand. </b>
Is there anyway I can get the currently expanded node., Kindly help me out in this.
Points will be rewarded for helpful answers. Thanks in advance.
Regards,
Nirmal
Hi,
Have you checked the action parameter, if that doesnt help
as a work around you can try creating a calculated attribute of type boolean and bind this to the expanded property of the Tree By Nesting Table Column.
When you expand and collapse the call will come to this get and setters.
their you can try to set the lead selection to the the element.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Ayyapparaj ,
<b>First I would like to thank you for your reply.</b>
So it means that we cannot identify the currently expanded node in tree UI element and It will always be the lead selection node we will be able to get rite?
Can we make the current lead selection to currently expanded node 'By Default'?
Coming back to your solution.,
I created a context element 'isExpanded' of type boolean inside the TreeNode.
You said that there will be a call made to 'getter and setter' methods while we expand the node and we can set the lead selection to that element from there.
Could you please give me some more details of how to achieve it.
Thanks in advance.
Regards,
Nirmal G
Hi Nirmal,
You can get the thing you are looking for.
http://help.sap.com/saphelp_nw70/helpdata/en/ef/965640f5f60272e10000000a155106/frameset.htm
Go through this example. The parameter mapping needs to be done in WDDoModifyView for that.
Regards,
Murtuza
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.