I have a backing bean called Menu that has a method getMenuItems() that
returns a List of MenuItems. Each MenuItem has an id, title, and child
MenuItems which are in a List.
I want the url of menu items to be a join of the menuitem's id and its
ancestors' id.
Eg. if we are on 'a' and its parent is 'b' and its parent is 'c' then i
want the url to be c/b/a.xhtml
What is the best way to go about doing this?
The only thing I can think of doing is adding a method on to MenuItem
called getURL(). That would work but I would rather not do that simply .
Anyone have another solution?
I want to do something like.... #{menu.createURL(currentMenuItem)}
but as far as I know you can't call methods with arguments.
Thanks,
David
(Just to note, I have no problem with adding getParent() on to menu
items even though I don't have it right now.)