css - 如何显示 <b :iconAwesome> instead of a <b:commandButton>?

标签 css jsf bootsfaces

我想知道,有没有办法替换<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" />
    

Example of a BootsFaces image commandButton

  • 如果您想显示图像而不是按钮,同时保留按钮功能,请添加几个内联样式(另请参阅 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/

相关文章:

css - 较高分辨率的媒体查询覆盖较低分辨率的媒体查询

javascript - 为什么使用 jQuery 组件的函数调用会重新加载 xhtml 页面?

css - 使 bootsfaces 模态水平滚动

jsf - Bootsfaces 与 Bootstrap

javascript - 我正在制作一个循环的连续图像 slider ,但我无法很好地过渡

CSS 将 px 更改为 %

html - 为什么 Bootstrap 页脚不起作用?

Java 推断类型化 HashSet 的类型错误

jsf - JSF 中的组件绑定(bind)是什么?何时首选使用?

javascript - 如何将 JSF Bean 数据传递给 JavaScript 函数?