Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Problem with MenuItem.getSubmenu()

$
0
0
SmartClient Version: v9.1p_2014-07-13/LGPL Development Only (built 2014-07-13)

When I rolled from 4.0 to 4.1, the MenuItem.getSubmenu() method was deprecated. This seems to be causing issues for me. The deprecation points me to using Menu.getSubmenu(), but this does not do the same thing.

I have some generic menu handling routines that need to walk the menu structure. To do that I need to find out if a menu item has a submenu associated with it and walk it. Before I could use MenuItem.getSubmenu() to do this because it would return null if the item did not have a submenu.

However, the suggested replacement method - Menu.getSubmenu() - seems like it cannot be used for this. It appears from the documentation (and the behavior I am seeing) that every time I call it, it creates a new submenu for the item which is obviously not what I want when trying to enumerate the menu tree.

Is there a method that replaces the deprecated functionality of MenuItem.getSubmenu's capability to test if a menu item has a submenu without creating one?

Viewing all articles
Browse latest Browse all 4756

Trending Articles