views:

25

answers:

1

My question is how do i get the grails navigation plugin to show subItems?

I did a simple thing and added the following to top of my Controller:

class DummyController {
   static navigation = [group: 'tabs', 
                        title: 'dummy',
                        action: 'list',
                        subItems: ['create', 'save']
def create = {....

In main.gsp I added the following:

<head>
...
   <nav:resources/>
</head>
<div id="menu">
   <nav:render group="tabs"/><br/>
   <nav:renderSubItems group="tabs"/>
</div>

Expecting this to work instead i get an exception:

Cannot invoke method toLowerCase() on null object

Jira has this bug filed and someone mentions adding:

if(!controllerName) return out

To the top of def renderSubItems function in NavigationTagLib.groovy which i have. It now no longer throws that error but my sub-menu items still dont display.

Any help on how to get the sub-menus displaying would be greatly appreicated Thanks

A: 

It seems it did work, when a menu item is selected the new page loads and shows 'create' and 'save' underneath on the new page.

I misunderstood and was expecting the subitems to appear before i clicked on the menu button, or if i hovered over the menu button. I wanted to use the YUI css and let nav plugin do the hardwork but this is not the style of menu im after. I wanted a more dynamic menu i.e. you hover over a menu item and it shows a dropdown of subitems allowing you to go directly to an action much like the YUI menubar.

Primus