0

I can't achieve to add a class in a facet :

<p:dataTable>
    <f:facet name="footer" class="myClass">
        <p>outch!</p>
    </f:facet>
</p:dataTable>

render :

<div class="ui-datatable-footer ui-widget-header ui-corner-bottom">
    <p>outch!</p>
</div>

perhaps it's not possible, but what can be the alternative to put myClass in the DIV class ?

Many thanks to any help ;-)

françois

Edit :

OK : facet have no attribut, so I'll try an other approch. thks all.

François
  • 1
  • 1
  • The facet tag does not have a class attribute. Are you trying to populate the list from a backing (managed) bean or what? – dsp_user Sep 14 '16 at 07:55
  • why not setting the `class` attribute of its child, in this case `p`? – ujulu Sep 14 '16 at 08:01
  • When you work with a CSS framework, the goal is to add classes to your elements (div, a, p, etc.), and not to override tons of Primefaces classes ;-) – François Sep 14 '16 at 08:29

1 Answers1

0

The facet tag does not have a class attribute as you can see in tag library documentation f:facet

If you want to override the default CSS for Primefaces datatable footer you can check this override-default-primefaces-css-with-custom-styles

Community
  • 1
  • 1
CosminC
  • 1
  • 3
  • Please add some explaination to your link-only answer, i.e. some relevant information of the linked source. – CSchulz Sep 14 '16 at 08:03
  • OK : facet tag does not have a class attribute. When you work with a CSS framework, the is to add classes to your elemnts, and not to override tons of Primefaces classes. So : no way to add a class near Primefaces ones? – François Sep 14 '16 at 08:13
  • I think it's not possible in this case. Only if primefaces tags have a `styleClass` attribute. – CosminC Sep 14 '16 at 08:33