jsf - PrimeFaces custom text on Menubar -


i using <p:menubar>. i've seen can use 'facet' render custom content, shown in showcase.

what want now, put text left first menuitem.

<h:form>     <p:menubar autodisplay="false">         <f:facet name="options">             <p:outputlabel value="my company"/>         </f:facet>         <p:menuitem value="home" outcome="index.xhtml" icon="ui-icon-pencil" style="float: right;"/>         <p:menuitem value="register" outcome="register.xhtml" icon="ui-icon-pencil" style="float: right;"/>         <f:facet name="options">             <p:commandbutton action="login.xhtml" value="login" icon="ui-icon-extlink"/>         </f:facet>     </p:menubar> </h:form> 

i hope it's clear mean. in case, outputlabel showing on right side of menubar.

in uicomponentbase facets stored in private map<string, uicomponent> facet. when define multiple facets same name "options" summarized 1 uicomponent in map (in case uipanel 2 children: <p:outputlabel ...> , <p:commandbutton ...>).

when debug through org.primefaces.component.tieredmenu.tieredmenurenderer.encodemenu() method (which renders menu) see, menu consists of list <ul> , every menuitem <li> tag. in last step "options" facet rendered last element in list. both tags appear on right.

for example extend org.primefaces.component.tieredmenu.tieredmenurenderer.encodemenu() method in custom renderer class additionally render texts beginning of menu.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -