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

别等时光非礼了梦想. 提交于 2019-12-02 02:04:20

问题


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:


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>


来源:https://stackoverflow.com/questions/24995284/how-to-put-image-instead-of-text-in-hcommandlink-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!