• Rahul r 56
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies


Lightning Component:

<aura:component controller="LC_Lst_Acnt_tile">
    <aura:attribute name="acco" type="Account[]"/>
     <aura:attribute name="Srchacc" type="string"/>
   
    <lightning:layout  multipleRows="True">
      <lightning:layoutItem size="4">
        <lightning:card title="Search Accounts">
           
            <aura:set attribute="actions">
               <lightning:button label="search" onClick="{!c.searchme}"/>
            </aura:set>
           
            <lightning:input label="Enter the Text" value="{!v.Srchacc}"/>
            </lightning:card>
          </lightning:layoutItem>
               
         <lightning:layout>
        <lightning:card title="Tile view">
             <aura:iteration items="{!v.acco}" var="sd"/>
            <lightning:layoutItem size="4">
                Name:{!sd.Name} <p/>
                Phone:{!sd.Phone}<p/>
                Fax:{!sd.Fax}<p/>
            </lightning:layoutItem>
           
          </lightning:card>
        </lightning:layout>
       
    </lightning:layout>
</aura:component>

-------------------------------------------------------------------------------------------------------

Controller:


({
searchme : function(component, event, helper) {
var aa= component.get("v.Srchacc");
        var action=component.get("c.TileAccount");
        action.setParams({"st":aa});
        action.setCallback(this,function(response){
           
            var state=response.getState();
            var res=response.getReturnvalue();
            component.set("v.acco",res);
        });
        $A.enqueueAction(action);
}
})


-------------------------------------------------------------------------------

Apex Class:



public class LC_Lst_Acnt_tile {

    @AuraEnabled
    public static List<Account> TileAccount(string st)
    {
        string query='select Name,Phone,Fax from Account where Name like \'%'+st+'%\'';
        List<Account> acc= Database.query(query);
        system.debug(acc);
        return acc;
    }
}


------------------------------------------------------------------------------------------

Lightning Application:

<aura:application extends="force.slds">
    <c:Lc_List_Account_tile/>
</aura:application>


--------------------------------------------------------------------------------------------


Error Message:



This page has an error. You might just need to refresh it.
Assertion Failed!: Unable to get value for key 'sd.Name'. No value provider was found for 'sd'. : false
Failing descriptor: {c:Lc_List_Account_tile}


-------------------------------------------------------------------------

Hi All,

Can any one correct me where iam Wrong


Lightning Component:

<aura:component controller="LC_Lst_Acnt_tile">
    <aura:attribute name="acco" type="Account[]"/>
     <aura:attribute name="Srchacc" type="string"/>
   
    <lightning:layout  multipleRows="True">
      <lightning:layoutItem size="4">
        <lightning:card title="Search Accounts">
           
            <aura:set attribute="actions">
               <lightning:button label="search" onClick="{!c.searchme}"/>
            </aura:set>
           
            <lightning:input label="Enter the Text" value="{!v.Srchacc}"/>
            </lightning:card>
          </lightning:layoutItem>
               
         <lightning:layout>
        <lightning:card title="Tile view">
             <aura:iteration items="{!v.acco}" var="sd"/>
            <lightning:layoutItem size="4">
                Name:{!sd.Name} <p/>
                Phone:{!sd.Phone}<p/>
                Fax:{!sd.Fax}<p/>
            </lightning:layoutItem>
           
          </lightning:card>
        </lightning:layout>
       
    </lightning:layout>
</aura:component>

-------------------------------------------------------------------------------------------------------

Controller:


({
searchme : function(component, event, helper) {
var aa= component.get("v.Srchacc");
        var action=component.get("c.TileAccount");
        action.setParams({"st":aa});
        action.setCallback(this,function(response){
           
            var state=response.getState();
            var res=response.getReturnvalue();
            component.set("v.acco",res);
        });
        $A.enqueueAction(action);
}
})


-------------------------------------------------------------------------------

Apex Class:



public class LC_Lst_Acnt_tile {

    @AuraEnabled
    public static List<Account> TileAccount(string st)
    {
        string query='select Name,Phone,Fax from Account where Name like \'%'+st+'%\'';
        List<Account> acc= Database.query(query);
        system.debug(acc);
        return acc;
    }
}


------------------------------------------------------------------------------------------

Lightning Application:

<aura:application extends="force.slds">
    <c:Lc_List_Account_tile/>
</aura:application>


--------------------------------------------------------------------------------------------


Error Message:



This page has an error. You might just need to refresh it.
Assertion Failed!: Unable to get value for key 'sd.Name'. No value provider was found for 'sd'. : false
Failing descriptor: {c:Lc_List_Account_tile}


-------------------------------------------------------------------------

Hi All,

Can any one correct me where iam Wrong