denislexic
denislexic

Reputation: 11342

JSF - <h:commandButton or equivalent to ouput <button> HTML output?

Is there a way for JSF to output something like this:

<button type="submit" ...></button>

I know that you are supposed to use <:hcommandButton /> normally but it outputs a <input type="submit"> instead and the front end developer wants to put a <i /> inside the button to have icons inside using font awesome.

Would be great if we could avoid using a custom component...it's pretty tedious.

Thanks.

Upvotes: 0

Views: 1343

Answers (2)

BalusC
BalusC

Reputation: 1108672

Yes, it's the <h:button>.

<h:button value="Label" outcome="page.xhtml" />

PrimeFaces has a more customizeable one as <p:button>.

Note that you can also just write down plain HTML in JSF and if necessary just wrap it in a composite component or a tag file.

See also:

Upvotes: 3

Mohamed Aymen Charrada
Mohamed Aymen Charrada

Reputation: 415

<h:button> output is <input type="button"> and not <button> output in HTML

Upvotes: 0

Related Questions