Search code examples
cssjsfprimefacesfont-awesomejsf-2.2

Adding refresh icon in JSF panel header


I'm using JSF/Prime faces for UI. Here I have a data-table inside a Panel. I need to have a Refresh Icon provided for Font Awesome in Panel's header. On Click of refresh icon data in data-table should get refreshed. How can I achieve it?

I tried adding icon attribute and also tried using <i> tag, but didn't work

<p:panel header="Top" styleClass="dynamicleftinnerheader" icon="fa fa-refresh">
    <p:dataTable value="#{controller.dataTable}" var="top" scrollHeight="50">
        <p:column headerText="Item">
            <h:outputText value="#{top.item}"/>
        </p:column>
</p:panel>

Solution

  • I tried with Custom Actions provided by prime faces and it's working.