I am customizing the Rio templates for my applications and needed to add an item to the layout-menu that executes an action. I successfully add the menu item using a p:commandLink as shown below:
Code: Select all
<li>
<h:form id="log-out-form">
<p:commandLink
id="log-out"
action="#{sessionBean.logout}"
ajax="false"
style="color: rgb(69,90,100);"
styleClass="menulink ripplelink">
<i class="icon-close47 Fs16"></i> Logout
</p:commandLink>
</h:form>
</li>
The above menu item works well but after the first click the color turns permanently blue. I tried to force the color back to the default darker color but I think an !important css entry on commandlink is overriding my efforts. Regardless, I began to wonder why did PrimeFaces use a list of anchors for the layout-menu instead of the pr:menu. The pr:menu seems to be more flexible and supports actions out of the box.