cancel
Showing results for 
Search instead for 
Did you mean: 

Hierachical Tree + Dynamic binding

emmanuel_turci
Advisor
Advisor
0 Kudos

Hi All,

That's a tricky question for you guys.

I would like to create a dynamic binding with a Hierachical Tree.

So I have a contextual menu for each element of this tree.

In my doModifyView(), only the first time, I create a new menu action which I add in this contextual Menu.

Then I want to bind the 'enable' property of this menu action to one element in the HierarchicalTree.

Something like :

newMenuAction.bindEnabled("HierTree. ... .isLeaf");

where 'isLeaf' is a boolean attribute.

ok, you know my story

Thanks a lot for your help.

Best regards,

Emmanuel.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I assume you are talking about NW04s.

Regarding the menus in NW04s: These are not real context menus. Rather they are static menus that may be attached to certain UI elements.

If the UI element provides an action (e.g. LinkToAction), the menu is visualized by a so-called popup-trigger, a little button permanently visible beside the element.

If the UI element is passive (e.g. TextView), the menu is visualized by a popup-trigger that appears when the mouse is moved over the element.

The tree is different. The menu attached to a TreeNodeType or TreeNodeItem appears on right-click.

Now to the menus in a tree: You can attach a menu per tree node type, not per tree node. Nevertheless, you can use data binding to get different texts or enabled-states of the menus for different tree nodes. But you cannot have <b>structurally </b>different menus per tree node.

Another drawback is, that these kind of menus is rendered inside the view layout and is multiplied with the data binding variation.

So my advice is: Don't try to simulate real context menus with these static menus, it leads to nowhere.

Last but not...: Real context menus will come in a later release. There you will have a callback before the menu is opened and you get full flexibility.

Armin

Answers (0)