如何在h:commandLink值中放置图像而不是文本 [英] How to put image instead of text in h:commandLink value

查看:102
本文介绍了如何在h:commandLink值中放置图像而不是文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个命令链接如下。

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.

我该如何实现?

推荐答案

你应该删除 value 属性并在<$ c $里面加上< h:graphicImage> c>< h:commandLink> 。

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>

这篇关于如何在h:commandLink值中放置图像而不是文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆