Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generally use PrimeIcons of PrimeFaces

Tags:

primefaces

I'm a bit confused to not find anything here, how to use PrimeIcons of PrimeFaces. I just wanted to use the icon of an PrimeFaces example:

 <p:contextMenu for="table">
     <p:menuitem value="Löschen" update="table" icon="pi pi-times" action="#{telefonbuchList.deleteEntry}"/>
 </p:contextMenu>

The "pi pi-times". Instead I just get a ^. I don't even want to use FontAwesome and this stuff right now. I thought the icons are already implemented with the dependency of PrimeFaces, but I seem to be wrong.

like image 297
CptDayDreamer Avatar asked Jan 28 '19 15:01

CptDayDreamer


1 Answers

First... you must be using PF 6.2.11 or 7.0 or higher: https://github.com/primefaces/primefaces/issues/4228

Second you add this to your XHTML:

<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces"/>

Update 03/16/2021: Starting with PrimeFaces 10.0.0 PrimeIcons is automatically added to all pages.

like image 191
Melloware Avatar answered Nov 03 '22 04:11

Melloware