primefaces menubar logout right side
13,516
Solution 1
You should use a style="float: right;" inside the button or include the property into your css stylesheet.
Solution 2
I am able to get the logout to the right by using the below code
<f:facet name="options">
<p:commandButton type="button" value="Logout" />
</f:facet>
Related videos on Youtube
Author by
borj
Updated on August 30, 2022Comments
-
borj over 1 year
Hi I followed this code but my logout button is not at the right side of menubar.
here is my xhtml page
<h:body> <p:menubar autoDisplay="false"> <p:menuitem value="Home" url="/index.jsf" /> <p:submenu label="Maintenance" > <p:menuitem value="Course" url="/views/course/list.jsf" /> <p:menuitem value="Student" url="/index.jsf" /> </p:submenu> <f:facet name="options"> <p:commandButton type="button" value="Logout" icon="ui-icon-extlink" /> </f:facet> </p:menubar> </h:body>
-
borj over 11 yearsIt only works when I remove it from menubar, it kills the purpose of menubar.
-
AgostinoX about 11 yearsIt works for me. I'm wondering how much tricky is this solution, that is if it is guaranteed to work in different contions and browsers. btw, i'm using pf 3.2
-
AgostinoX about 11 yearsThen the menù itself goes beyond the edge of the browser window because it is alligned with the starting of the item in the menù bar. I've adjusted this in a rather tricky way this way: style="float:right;margin-right: 30px;"
-
kleopatra over 10 yearsNote that link-only answers are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference.