0

I have searched about sales force Lightning ..That time I got one Intersting Link

<aura:iteration> won't work with your database object untill u wire up a controller class in your component and write the method inside the controller to fetch the data.

For Information please refer below link https://developer.salesforce.com/forums/?id=906F0000000B37pIAC

I want to know the exact reason beyond this line ???!!!...

================================================

  <aura:component controller="SamplePic">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="User" type="User[]"/>
<center>
    <p>  Simple Image Component</p></center>

 <aura:iteration items="{!v.User}" var="User">
     {!User.Id} 
     <br/>
     {!User.smallPhotoURL}
     <br/>
</aura:iteration>

=========================================

    ({
doInit : function(component, event, helper) {
    alert('page loading calling @@@');
    var action=component.get("c.SamplePic1");
    action.setCallback(this,function(a){
        var state=a.getState();
        if(state==='SUCCESS'){
            alert('success value');
            //alert('list value ::::::'+JSON.stringify(a.getReturnValue()));
            component.set("v.User",a.getReturnValue());
        }
    });
    $A.enqueueAction(action);
}

})

==========================================

  public class SamplePic {
@AuraEnabled
public static String photoURL {get;set;}
@AuraEnabled
public  static List<User> SamplePic1() {
    system.debug('::::: usr method is calling :::');
    return[SELECT Id,smallPhotoURL FROM User];

}

}

2
  • Did you implement anything and stuck in a specific scenario or question?
    – Raul
    Commented Mar 8, 2017 at 12:07
  • @RahulSharma In above code Iam getting user Id in component,but Iam not getting smallphotoUrl ...Once I used FullPhotoUrl Its working...Simply I searched in Google So I got this link developer.salesforce.com/forums/?id=906F0000000B37pIAC ..So I have asked the question
    – Annappa PH
    Commented Mar 8, 2017 at 12:20

1 Answer 1

2

The merge variables are case sensitive and {!User.smallPhotoURL} is the wrong case. It should be {!User.SmallPhotoUrl} instead.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .