0

I am working on JSF 2.2

Font awesome 'fonts' work with html buttons of type submit. Since a <h:commandButton> is exactly that; a button of type submit, why can't i add fon't awesome to it?

Is it a limitation of <h:commandButton> in jsf?

My code:

  <h:commandButton 
      styleClass="btn btn-default" 
      action="#{myBean.name}" >

      <i class="fa fa-trash" style="font-size: 1em"> </i>

  </h:commandButton>

I know that i can use <h:commandLink> instead as described here. But when i am making a button, its not intuitive to make a link instead, which is what <h:commandLink> appears as.

gogogaga
  • 175
  • 1
  • 3
  • 11
  • 2
    Can you add a font-awesome icon on a plain html button? Since that is what the jsf button renders into. If you can, post the required html and then we'll try to port it to a jsf button – Kukeltje May 16 '18 at 12:21
  • 1
    have you tried BootsFaces? it includes font awesome support like `` https://www.bootsfaces.net/ – MitchBroadhead May 16 '18 at 13:13
  • See also: https://stackoverflow.com/a/35506024/59087 – Dave Jarvis Oct 05 '18 at 18:18

0 Answers0