我想知道,有没有办法替换<b:commandButton>
的默认按钮?用<b:iconAwesome>
.
但是,它确实适用于 <h:commandLink>
, 完美。
<h:commandLink>
<b:iconAwesome name="arrow-down"></b:iconAwesome>
</h:commandLink>
对于替换,我的意思是完全替换而不是,图标在按钮上。只需检查上面的工作代码。
还有其他提示要提吗?
(注意:<b:...>
是 BootsFaces 的一个组件。)
最佳答案
两个答案:
要在 commandButton 中显示图标,只需添加 iconAwesome 属性:
<b:commandButton value="" ajax="true" update="form:inform infoshow" iconAwesome="thumbs-up" look="info" />
如果您想显示图像而不是按钮,同时保留按钮功能,请添加几个内联样式(另请参阅 here ):
<b:commandButton value="" ajax="true" update="form:inform infoshow" iconAwesome="thumbs-up" look="info" style="padding: 0; border: none; background: none;color: #000" />
如果您需要更大的灵 active :我们已经在努力了。 BootsFaces 0.8 将允许您在
<b:commandButton />
中嵌套任意 HTML ,与您在<b:commandLink />
中所做的完全一样例子。您可以在我们的错误跟踪器上查看进度:https://github.com/TheCoder4eu/BootsFaces-OSP/issues/65
关于css - 如何显示 <b :iconAwesome> instead of a <b:commandButton>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31729994/