问题
<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