You need to sign in to do that
Don't have an account?
kumar_arun
How to show a formula field(have Image) of an object in lightning component.
I want to show formula field that is in Lead Object,And this formula field contains Image. when i call this field in component in OutputText it show url of Image. please help me. I don't know how to use OUTPUTRICHTEXT
Component: <aura:component controller="LeadLightningContoller"> <ltng:require styles="/resource/SLDS103/assets/styles/salesforce-lightning-design-system.min.css"/> <aura:attribute name="Leads" type="Lead[]"/> <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <aura:iteration items="{!v.Leads}" var="lead"> <ui:outputText value="{!lead.Rating_Image__c}"/> </aura:iteration>
helper Class ({ getLeadList : function(component) { var action=component.get("c.ShowLead"); action.setCallback(this,function(res){ var status=res.getState(); if(status=="SUCCESS"){ component.set("v.Leads",res.getReturnValue()); } }); $A.enqueueAction(action); } })
Controller public class LeadLightningContoller { @AuraEnabled public static List<Lead> ShowLead(){ List<Lead> leadList=new List<Lead>(); leadList=[select Name,Email,Status,Phone,No_of_days_Open__c,Rating,Fax,Rating_Image__c from Lead limit 10]; return leadList; } }
Application <aura:application > <c:LeadData /> </aura:application>
I already know how it is.
Use the outputRichText tag, like this:
<ui:outputRichText value="{!contact.Image__c}"/>
I am using ui:outputRichText to display image and its working fine as expected, but i have to do something on selection of that record. How to acheive this. I am using click, dlbclick events but its not working. Anyone help please