Search code examples
javawebobjects

D2W in Wonder Project doesn't show submenus


I have a very simple navigationMenu.plist from one example in the Wonder site:

(    
    {
        name = Root;
        directActionClass = DirectAction;
        directActionName = default;
        children = "session.navigationRootChoice";
        childrenChoices = {
            home = (
                Posts,
                Authors,
            );
        };
    },
    {
        name = "Posts";
        action = "session.navController.listPostsAction";
        children = ("CreatePost","SearchPosts");
        conditions = ("context.hasSession");
    },
    {
        name = CreatePost;
        action = "session.navController.createPostAction";
    },
    {
        name = SearchPosts;
        action = "session.navController.searchPostsAction";
    },
    {
        name = Authors;
        action = "session.navController.listAuthorsAction";
        children = ("CreateAuthor","SearchAuthors");

    },
    {
        name = CreateAuthor;
        action = "session.navController.createAuthorAction";
    },
    {
        name = SearchAuthors;
        action = "session.navController.searchAuthorsAction";
    }
)

However, when I run the application, submenus are not shown. I am pretty sure this has to be a property that needs to be turned on. Any ideas will be appreciated.

Thanks.


Solution

  • I thought children was an array of strings. From one of my NavigationMenu.plist

    {
        name = Root;
        children = ("Home","Person","Computer", "ComputerModels");
    },
    {
        name = "Home";
        action = "session.navController.homeAction";
    },
    {
        name = Person;
        action = "session.navController.listPersonAction";
        children = ("createPerson", "findPerson", "Logout");
    },
    {
        name = createPerson;
        action = "session.navController.createPersonAction";
    },
    {
        name = findPerson;
        action = "session.navController.findPersonAction";
    }
    

    Don't forget to set the navigationState rule in your rule model.

    50 : pageConfiguration like '*Person' => navigationState = "Person" [com.webobjects.directtoweb.Assignment]