I am trying to add a submenu to a submenu in a dynamic menu model.
Code seems to work but the nested menu is not collapsing.
Below is the code:
Items in submenu 2 is collapsing. but the submenu 1 itself is not collapsing.
Code: Select all
DefaultSubMenu submenu1 = new DefaultSubMenu("Submenu 1"); DefaultSubMenu submenu2 = new DefaultSubMenu("Submenu 2"); DefaultMenuItem item = new DefaultMenuItem("Menu Item 1"); submenu2.addElement(item); submenu1.addElement(submenu2); model.addElement(submenu1);
Appreciate your help!
I am using