0

Unsupported child for menu: <menuitem null>

asked 2017-04-17 09:05:28 +0800

bayuprams gravatar image bayuprams
1

Hi i want to ask, i'm having weird error

org.zkoss.zk.ui.UiException: Unsupported child for menu: <menuitem null=""> at org.zkoss.zul.Menu.beforeChildAdded(Menu.java:139)

Any solutions? please i'm so confused.

here my code

List<MenuDummy> menuDummyList = mDJPAController.findParentMenu();
for (MenuDummy menuEntry : menuDummyList) 
if (SecurityUtil.isAllGranted(menuEntry.getComponentName())) {

            Component component = null;
            component = createMenu(menuEntry);
            menuBar.getChildren().add(component);       
        }

}

private Component createMenu(final MenuDummy menuEntry1) {
    Menu menuitems = new Menu();
    menuitems.setLabel(menuEntry1.getMenuName());
    menuitems.setId(menuEntry1.getId());
    menuitems.setIconSclass("glyphicon glyphicon-list");
    menuitems.setAttribute("navigationEntryModel", menuEntry1); 



    List<MenuDummy> menuDummyList1 = mDJPAController.findChildMenubyId(menuEntry1.getId());
    for (MenuInfomedia subEntry : menuDummyList1) 
        if (SecurityUtil.isAllGranted(subEntry.getComponentName())){

            Component component = null;
            component = createMenuItem(subEntry);
            menuitems.getChildren().add(component);
    }
    return menuitems;       
}

private Component createMenuItem(final MenuDummy menuEntry1) {
    Menuitem menus= new Menuitem();
    menus.setLabel(menuEntry1.getMenuName());
    menus.setAttribute("navigationEntryModel", menuEntry1);
    menus.addEventListener("onClick", new EventListener() {
    public void onEvent(Event event) throws Exception {
        System.out.println("ok");
        ZKUtil.showPage(
                menuEntry1.getZulName(),
                menuEntry1.getId(),
                menuEntry1.getMenuName(),
        null);
    }
});
    return menus;
}
delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2017-04-17 09:05:28 +0800

Seen: 26 times

Last updated: Apr 17 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More