You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Alexandre Corrêa Barbosa <al...@gmail.com> on 2007/05/10 17:07:23 UTC

Problems rendering navigationMenuItems

Hi folks,

I'm trying to make a menu using <t:panelNavigation2>, wtih dynamic menu
items. Below is the jsp code I'm using:

<h:form>
> <t:div id="menu" forceId="true" >
>     <t:panelNavigation2 layout="list"
>         itemClass="off" activeItemClass="on" openItemClass="on">
>         <t:navigationMenuItems id="items" value="#{GMList.items}" />
>     </t:panelNavigation2>
> </t:div>
> </h:form>
>

I'm using the following code to retrieve the menu items from my backing
bean:

    public getItems() {
>         ArrayList items = new ArrayList();
>
>         NavigationMenuItem menu1 = new NavigationMenuItem( "Label1",
> "Action1", null, false );
>         NavigationMenuItem[] menu1Items = {
>                 new NavigationMenuItem( "Label1.1", "Action1.1", null,
> false ),
>                 new NavigationMenuItem( "Label1.2", "Action1.2", null,
> false ),
>                 new NavigationMenuItem( "Label1.3", "Action1.3", null,
> false )
>         };
>         menu1.setNavigationMenuItems( menu1Items );
>
>         NavigationMenuItem menu2 = new NavigationMenuItem( "Label2",
> "Action2", null, false );
>
>         NavigationMenuItem menu3 = new NavigationMenuItem( "Label3",
> "Action3", null, false );
>         NavigationMenuItem[] menu3items = {
>                 new NavigationMenuItem( "Label3.1", "Action3.1", null,
> false ),
>                 new NavigationMenuItem( "Label3.2", "Actino3.2", null,
> false )
>         };
>         menu3.setNavigationMenuItems( menu3items );
>
>         items.add(menu1);
>         items.add(menu2);
>         items.add(menu3);
>     }
>


The problem is that only the main items ( 'Label1', 'Label2' and 'Label3' )
are being rendered. None of it's children are rendered.
Debuggin myFaces, I've seen that the children menu items are being
processed, despite not being rendered. Below is the debug log for the
childrens of 'Label1':

2007-05-10 11:59:18,133 5613424 DEBUG [
org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer] (
http-0.0.0.0-8180-1:) Label1 id:_idJsp1__idJsp2_item0
2007-05-10 11:59:18,133 5613424 DEBUG [
org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer] (
http-0.0.0.0-8180-1:)     Label1.1 id:_idJsp1__idJsp2_item0_item1
2007-05-10 11:59:18,133 5613424 DEBUG [
org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer] (
http-0.0.0.0-8180-1:)     Label1.2 id:_idJsp1__idJsp2_item0_item2
2007-05-10 11:59:18,133 5613424 DEBUG [
org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer] (
http-0.0.0.0-8180-1:)     Label1.3 id:_idJsp1__idJsp2_item0_item3


Am I missing something here. Someone could give me a tip on that?

Thanks in advance,
Alexandre

-- 
Alexandre Corrêa Barbosa
http://mydevelopmentjournal.blogspot.com (meu blog de tecnologia)
http://log4dev.wordpress.com (blog de tecnologia de Miguel Galves, onde sou
colaborador)

Re: Problems rendering navigationMenuItems

Posted by Alexandre Corrêa Barbosa <al...@gmail.com>.
Sorry guys,

I should have set the panelNavigation2's attribute renderAll="true".  Now
it's working.

Thanks,
Alexandre

On 5/10/07, Alexandre Corrêa Barbosa <al...@gmail.com> wrote:
>
> Hi folks,
>
> I'm trying to make a menu using <t:panelNavigation2>, wtih dynamic menu
> items. Below is the jsp code I'm using:
>
> <h:form>
> > <t:div id="menu" forceId="true" >
> >     <t:panelNavigation2 layout="list"
> >         itemClass="off" activeItemClass="on" openItemClass="on">
> >         <t:navigationMenuItems id="items" value="#{GMList.items}" />
> >     </t:panelNavigation2>
> > </t:div>
> > </h:form>
> >
>
> I'm using the following code to retrieve the menu items from my backing
> bean:
>
>     public getItems() {
> >         ArrayList items = new ArrayList();
> >
> >         NavigationMenuItem menu1 = new NavigationMenuItem( "Label1",
> > "Action1", null, false );
> >         NavigationMenuItem[] menu1Items = {
> >                 new NavigationMenuItem( "Label1.1", "Action1.1", null,
> > false ),
> >                 new NavigationMenuItem( "Label1.2", " Action1.2", null,
> > false ),
> >                 new NavigationMenuItem( "Label1.3", "Action1.3", null,
> > false )
> >         };
> >         menu1.setNavigationMenuItems( menu1Items );
> >
> >         NavigationMenuItem menu2 = new NavigationMenuItem( "Label2",
> > "Action2", null, false );
> >
> >         NavigationMenuItem menu3 = new NavigationMenuItem( "Label3",
> > "Action3", null, false );
> >         NavigationMenuItem[] menu3items = {
> >                 new NavigationMenuItem( " Label3.1", "Action3.1", null,
> > false ),
> >                 new NavigationMenuItem( "Label3.2", "Actino3.2", null,
> > false )
> >         };
> >         menu3.setNavigationMenuItems( menu3items );
> >
> >         items.add(menu1);
> >         items.add(menu2);
> >         items.add(menu3);
> >     }
> >
>
>
> The problem is that only the main items ( 'Label1', 'Label2' and 'Label3'
> ) are being rendered. None of it's children are rendered.
> Debuggin myFaces, I've seen that the children menu items are being
> processed, despite not being rendered. Below is the debug log for the
> childrens of 'Label1':
>
> 2007-05-10 11:59:18,133 5613424 DEBUG [
> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer]
> (http-0.0.0.0-8180-1:) Label1 id:_idJsp1__idJsp2_item0
> 2007-05-10 11:59:18,133 5613424 DEBUG [
> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer ]
> (http-0.0.0.0-8180-1:)     Label1.1 id:_idJsp1__idJsp2_item0_item1
> 2007-05-10 11:59:18,133 5613424 DEBUG [
> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer]
> (http-0.0.0.0-8180-1:)     Label1.2 id:_idJsp1__idJsp2_item0_item2
> 2007-05-10 11:59:18,133 5613424 DEBUG [
> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlNavigationMenuRenderer]
> (http-0.0.0.0-8180-1:)     Label1.3 id:_idJsp1__idJsp2_item0_item3
>
>
> Am I missing something here. Someone could give me a tip on that?
>
> Thanks in advance,
> Alexandre
>
> --
> Alexandre Corrêa Barbosa
> http://mydevelopmentjournal.blogspot.com (meu blog de tecnologia)
> http://log4dev.wordpress.com (blog de tecnologia de Miguel Galves, onde
> sou colaborador)




-- 
Alexandre Corrêa Barbosa
http://mydevelopmentjournal.blogspot.com (meu blog de tecnologia)
http://log4dev.wordpress.com (blog de tecnologia de Miguel Galves, onde sou
colaborador)