I would like to use redirection and action using DefaultMenuItem
My code
MenuModel menuModel = new DefaultMenuModel(); DefaultSubMenu menu = new DefaultSubMenu("menu"); DefaultMenuItem item = new DefaultMenuItem("new Menu"); item.setCommand("redirection"); // redirection is configured in faces-config.xml item.setCommand("#{myBean.init}"); menu.addElement(item) menuModel.addElement(menu);
but it does not work
(he worked earlier when there wasn’t
item.setCommand("#{myBean.init}");
)
Apparently having two setCommand gives some problems
but i need to initialize when i click the button.
could you help me?
source share