Rithik_Star
Rithik_Star

Reputation: 661

How to put image instead of text in h:commandLink value

I have a command link as below.

<h:commandLink value="Home" action="homePage">
</h:commandLink>

This is working fine, but I need a image instead of text value. The image has to act as a command link.

How can I achieve this?

Upvotes: 2

Views: 12566

Answers (1)

cmenti
cmenti

Reputation: 116

You should remove value attribute and put <h:graphicImage> inside <h:commandLink>.

<h:commandLink action="homePage">
    <h:graphicImage value="resources/images/img.png" />
</h:commandLink>

Upvotes: 7

Related Questions