cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming of node in Tree UI Element

Former Member
0 Kudos

Hi All

I have populated the Tree Structure as shown below

A
 A1
 A2
 A3

B
 B1
  B11	
  B12
  B13	
 B2
 B3

C
 C1
 C2
  C21
  C22
  C23		
 C3
 C4

Can you please let me know How to rename of nodes A,A1,B,B1,B11, and C21??

my requirement is once i select any node either parent or child node or any node then popup opens where current value of a node can be retrieved and user can enter new name where he/she enters new name then that new name could be renamed to the selected node on click of an action.

If any body helps for sample code on this requirement then it would be great help to me.

Thanks

Kalki Reddy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

First of all: very strange requirement to let an user change the internal name of context nodes.

You should define value attributes in your nodes, which then can be changed by the user or an action can be executed by the application when clicked upon.

Hope this helps a little.

Regards,

Alain

Answers (1)

Answers (1)

Former Member
0 Kudos

In release >= 7.1 I would do that using a context menu. In earlier releases you could use a static menu at the TreeNodeType or TreeItemType. But I would not open the renaming dialog on selection of a tree node.

How to do that with a static menu?

- Add menus to the TreeNodeType/TreeItemType instances of your tree.

- Create an action "RenameTreeNode" with a parameter "treeNodeContextElement" of type IWDNodeElement.

- Add MenuActionItem to the menu, assign above action and define event parameter mapping "nodeElement" -> "treeNodeContextElement"

Then you will know the context element that represents the tree node where the menu is opened in the action handler of the menu item. In the action handler, open a popup window with an input field to enter the new name for the tree node. Use context mapping to pass the inout field value to the view controller that opens the popup. In the close action of the dialog, assign the edited value to the context element representing the tree node.

Armin