cancel
Showing results for 
Search instead for 
Did you mean: 

Access Tree Elements

0 Kudos

Hi,

i implemented a tree structure in a table with MasterColumn UI element . I added also to MasterColumn two Menu UI Elements. It schould be possible for user, after clicking one of the tree element to choose function -add to filter-, and this currently used element name must be copied and transferred to another view. Unfotunataly i can't find any solution for these problems:

nodeTable()->root element,

1)wdContext.nodeTable().getTitle() , it gives only currently selected element, or the first element if nothing was selected, i can't get the Element who has called this menu action.

2) if i even select some line in table, i can get only the root element name, not child element name

Could you please help?

Thank you very much.

Kind Regards,

Daria

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Say you have attached a menu with a MenuActionItem to the table cell editor, and have assigned an action "Filter" to the menu item.

Add a parameter "treeNode" of type I<DataSource>Element to the action.

Define a parameter mapping for the menu item that maps parameter "nodeElement" to action parameter "treeNode". This can either be done by code in wdDoModifyView() or if available using the parameter mapping editor (Outline view, right-click on menu item, select from context menu "Parameter Mapping")

Then the action parameter "treeNode" will contain the node element describing the tree node where the menu was opened.

Armin

0 Kudos

Hi Armin,

Thank you very very much!!!!!

i added a parameter("filterParam") as you sad in Filter action and mapped in wdDoModifyView() this way:

IWDMenuActionItem menu =(IWDMenuActionItem)view.getElement("MenuActionItem");

menu.mappingOfOnAction().addSourceMapping("nodeElement","filterParam");

Now it's working!!!

I only need now to differ nodes (wich level it is) to copy it to the right view Inputfield. I hope it's possible just by adding a new value attribute such as typeOfnode to Table(datasource) Node ...

One question.

Is "nodeElement" parameter defined in meta model of Mastercolumn UI?

Thank you once more for help!

Kind regards,

Daria

Former Member
0 Kudos

The "nodeElement" event parameter is not explicitly defined in the UI element model. It is provided automatically by the framework and describes the "data-context" (e.g. table row, tree node, etc.) in which an event occured.

If you need to write the parameter mapping statement in the code, you can use the constant IWD<UIElement>.IWD<Event>.NODE_ELEMENT instead of the string literal.

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

hai Daria,

For getting the parent elements just use the method getparentelement() method.Call this method recursively to get all the parents of the leaf element.Try this and let me if there is any issues.

Thanks n Regards

Sharanya.R