How to put image instead of text in h:commandLink

2020-04-16 05:37发布

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?

1条回答
我命由我不由天
2楼-- · 2020-04-16 05:58

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>
查看更多
登录 后发表回答