You need to sign in to do that
Don't have an account?

getting error like below please help me...I am learning lightning
harnessApp.app:


But i am getting above error when click on the button packed!.....
- <aura:application >
- <c:campingListItem item="{!v.a0d2800000DTLYOAA5}"/>
- </aura:application>
- <aura:component >
- <aura:attribute name="item" type="Camping_Item__c" required="true"/>
- <p> The Item is <ui:outputText value="{!v.item}"></ui:outputText></p>
- <p>Name:<ui:outputText value="{!v.item.Name}" /> </p>
- <p>Price: <ui:outputCurrency value="{!v.item.Price__c}" /> </p>
- <p>Quantity:<ui:outputNumber value="{!v.item.Quantity__c}" /> </p>
- <p>Packed:<ui:outputCheckbox value="{!v.item.Packed__c}" /> </p>
- <div><ui:button label="Packed!" press="{!c.packItem}"/>
- </div>
- </aura:component>
- ({
- packItem: function(component, event, helper) {
- var btn= event.getSource();
- var BtnMessage =btn.get("v.label");
- component.set("v.item",BtnMessage);
- var btnClicked = event.getSource();
- btnClicked.set("v.disabled",true);
- }
- })
But i am getting above error when click on the button packed!.....
In your app the calling the component syntax is wrong.
<c:campingListItem item="{!v.a0d2800000DTLYOAA5}"/> in this line you need to pass the Camping_Item__c type object, instead you are passing the a attribute "a0d2800000DTLYOAA5" which is not available in your harnessApp.app
if you are passing a record Id, it doesn't understand the type value more over when you have to get the object information in order to pass to the child component. Please go through the attributes trailhead. Make sure you understand the purpose of the attribute
the correct syntax would be
let me know if you have any question.
Thanks,
Pramodh