• brijesh yadav 57
  • 10 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2
Hi All,

I am not able to complete the challenge "Mark Item as Packed" getting error message  The campingListItem JavaScript controller isn't setting the 'Packed' value correctly.

Below is the code, please help

<aura:component >

    <aura:attribute name="item" type="Camping_Item__c" required="true"/>
    <aura:attribute name="buttonDisabled" type="String" default="false"/>

        <ui:outputCurrency value="{!v.item.Price__c}"/>
        <ui:outputText  value="{!v.item.Name}"/>
        <ui:outputNumber value="{!v.item.Quantity__c}"/>
        <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    <ui:button label="Packed!" press="{!c.packItem}" disabled="{! v.buttonDisabled}" />

    packItem : function(component, event, helper) {
        component.set("v.item", { 'sobjectType': 'Camping_Item__c','Packed__c': true });
        component.set("v.buttonDisabled", "true");  

Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?