xpages returning class icon in view column

与世无争的帅哥 提交于 2019-12-13 01:13:30

问题


<i class="fa-trash-o fa" /> ( from http://fortawesome.github.io/Font-Awesome/icons/ )

I want the above class to be the result for a column icon:

<xp:this.iconSrc><![CDATA[#{javascript:var class = "fa-trash-o fa";
if (rowData.isDocument() && rowData.getDocument()!= null) {
var formName = rowData.getDocument().getItemValueString("Form");

if ( formName == "Aform") {

// How can I reffer to the class? => The icon from the class will be shown. } 

]]></xp:this.iconSrc>

回答1:


You then shouldn't use the iconSrc / view icon setting of the column. Instead you have to compute your own HTML as a value in that column and set the FA-class depending on your column value(s). Make sure you set the content type for the column to "HTML" and not "Text".



来源:https://stackoverflow.com/questions/25376711/xpages-returning-class-icon-in-view-column

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