I have a context menu attached to tree nodes via componentControl.
Now I need to disable certain menu items based on the node the user invokes the context menu on.
How can I realize that?
I thought about 3 solutions yet:
1.) Do not attach the context menu via componentControl but adding the context menu directly to each tree node. This should work but in this case a context menu is inserted for every node resulting in a rather large page, right? So this does not scale well for hundreds of nodes.
2.) Using a4j:support to rerender the context menu based on the node clicked on and displaying context menu on onComplete. Question is how do I display the contextMenu via Javascript?
3.) Using componentControl as I do now and disabling menu items via Javascript just before the menu opens. Question is how can I disable menu items via Javascript?
Anyone any suggestions or other solutions?