You need to sign in to do that
Don't have an account?
Rahul r 56
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
Assertion Failed!
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
i have got the answer
in above program i have self closed the <aura:iteration>.this is why assertion failed now iam able to exute programe succesfully
Thanks...........!!!!!!!!!
2) javascript is case sensitive language, so it needs to have exact case otherwise will throw error .
response.getReturnvalue(); will be changed to response.getReturnValue();