Align submenu to the right of the menubar

UI Components for JSF
Post Reply
hfluz
Posts: 47
Joined: 01 Sep 2011, 15:31

11 Oct 2011, 19:24

Hi, I have a menubar at the top of my page. A set of menuitems and a submenu are contained by this menubar.

What I'm trying to do is to align only the submenu to the right, but the submenu tag doesn't provide a style atribute.

I experimented the primefaces versions 2.2.1 and 3M3, but the same happens on both.

Below is my menubar code:

Code: Select all

<p:menubar id="menu" style="overflow: visible;z-index: 20 !important">
                    <p:menuitem style="color: #ffffff;" icon="ui-icon ui-icon-home" value="Portal do Estudante de Graduação"
                                action="index" ajax="false"/>
                    <p:menuitem value="Estrutura ADM" url="http://www.uel.br/orgaos-reitoria/"/>
                    <p:menuitem value="Extensão" url="http://www.proex.uel.br/"/>
                    <p:menuitem value="Graduação" url="http://www.uel.br/prograd/"/>
                    <p:menuitem value="Pesquisa|Pós" url="http://www.uel.br/proppg/"/>
                    <p:menuitem value="Vestibular" url="http://www.cops.uel.br/"/>
                    <p:submenu icon="ui-icon ui-icon-person" label="Fulano">
                        <p:menuitem icon="ui-icon ui-icon-mail-closed" value="Alterar E-mail" ajax="false" action="alterarEmail"/>
                        <p:menuitem icon="ui-icon ui-icon-key" value="Alterar Senha" ajax="false" action="alterarSenha"/>
                        <p:menuitem icon="ui-icon ui-icon-closethick" value="Sair"/>
                    </p:submenu>
                </p:menubar>
Could someone give me some help to overcome this obstacle?
Last edited by hfluz on 24 Oct 2011, 22:17, edited 1 time in total.

bpap
Posts: 34
Joined: 30 Sep 2011, 16:15

12 Oct 2011, 13:03

For 3.0 M3 apply a styleClass:

Code: Select all

<p:menubar styleClass="myMenu" ....
and in css:

Code: Select all

.myMenu li.wijmo-wijmenu-parent > a {
	text-align: right;
}

.myMenu ul:first-child > li.wijmo-wijmenu-parent > a > span,
.myMenu ul:first-child > li.wijmo-wijmenu-parent > a > span > span {
	float: left !important;
}

.myMenu li.wijmo-wijmenu-parent > a > span,
.myMenu li.wijmo-wijmenu-parent > a > span > span {
	float: none !important;
	display: inline-block;
	vertical-align: bottom;
}
But menubar will be reimplemented for M4. See here viewtopic.php?f=3&t=6944&p=46921#p46886
Apache Tomcat 7.0.21 / JSF 2.1.2 / PM 3.0.M4-SNAPSHOT

hfluz
Posts: 47
Joined: 01 Sep 2011, 15:31

24 Oct 2011, 22:18

Thanks. I guess I'll wait for M4 then. ^^

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 54 guests