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/

相关文章:

javascript - 如何在用户滚动到它们之前加载 onScroll 背景图像?

html - 我可以制作设置为 justify-content : space-between align to the right when they wrap? 的元素吗

jsf - 根据 <h :outputText> 的值有条件地渲染 <div>

jsf - OmniFaces CombinedResourceHandler 需要很长时间才能加载

jsf - 验证消息未显示 <b :selectOneMenu>

php - 在 HTML 选择标签的选项中设置两个不同元素的样式

javascript - 如何数据绑定(bind) Angular-ui-bootstrap 轮播控件?

java - JSF 2.0 h :selectManyListbox f:selectItems - always empty

java - 在 JSF 2 中从同一命令调用不同的操作