• Ender Reinoso Salazar
  • NEWBIE
  • 35 Points
  • Member since 2017

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

I'm having an issue with this challenge. I'm getting the following error: 

"Challenge Not yet complete... here's what's wrong: 
The campingList component doesn't appear to have a Packed checkbox field in the form using a Lightning Base component."

My campingList component contains the following code:

<!-- CREATE NEW ITEM FORM -->
        <form class="slds-form--stacked">          
            <lightning:input aura:id="itemform" label="Item Name"
                             name="Name"
                             value="{!v.newItem.Name}"
                             required="true"/> 
            
            <lightning:input aura:id="itemform" label="Quantity"
                             name="Quantity"
                             value="{!v.newItem.Quantity__c}"
                             min="1"
                             type="decimal"/> 
            
            <lightning:input aura:id="itemform" label="Price"
                             name="Price"
                             value="{!v.newItem.Price__c}"
                             formatter="currency"
                            /> 
            
           
            <div class="slds-form-element">
                        <lightning:input aura:id="itemform" label="Packed"
                             name="Packed"
                             value="{!v.newItem.Packed__c}"
                             type="checkbox" 
                             />
                    </div>
            <lightning:button label="Create Item" 
                              class="slds-m-top--medium"
                              variant="brand"
                              onclick="{!c.clickCreateItem}"/>
        </form>
        <!-- / CREATE NEW ITEM FORM -->

Apparently the challenge is able to find the inputs for Price and Quantity but doesn't see the Package one.

Anybody else had the same problem? Is it an issue in my code?

Thanks
Hello, 

I'm having an issue with this challenge. I'm getting the following error: 

"Challenge Not yet complete... here's what's wrong: 
The campingList component doesn't appear to have a Packed checkbox field in the form using a Lightning Base component."

My campingList component contains the following code:

<!-- CREATE NEW ITEM FORM -->
        <form class="slds-form--stacked">          
            <lightning:input aura:id="itemform" label="Item Name"
                             name="Name"
                             value="{!v.newItem.Name}"
                             required="true"/> 
            
            <lightning:input aura:id="itemform" label="Quantity"
                             name="Quantity"
                             value="{!v.newItem.Quantity__c}"
                             min="1"
                             type="decimal"/> 
            
            <lightning:input aura:id="itemform" label="Price"
                             name="Price"
                             value="{!v.newItem.Price__c}"
                             formatter="currency"
                            /> 
            
           
            <div class="slds-form-element">
                        <lightning:input aura:id="itemform" label="Packed"
                             name="Packed"
                             value="{!v.newItem.Packed__c}"
                             type="checkbox" 
                             />
                    </div>
            <lightning:button label="Create Item" 
                              class="slds-m-top--medium"
                              variant="brand"
                              onclick="{!c.clickCreateItem}"/>
        </form>
        <!-- / CREATE NEW ITEM FORM -->

Apparently the challenge is able to find the inputs for Price and Quantity but doesn't see the Package one.

Anybody else had the same problem? Is it an issue in my code?

Thanks
Challenge - Create a form to enter new items and display the list of items entered. To make our camping list look more appealing, change the campingHeader component to use the SLDS. Similar to the unit, style the Camping List H1 inside the slds-page-header. Modify the campingList component to contain an input form and an iteration of campingListItem components for displaying the items entered.
The component requires an attribute named items with the type of an array of camping item custom objects.
The component requires an attribute named newItem of type Camping_Item__c with default quantity and price values of 0.
The component displays the Name, Quantity, Price, and Packed form fields with the appropriate input component types and values from the newItem attribute.
The JavaScript controller checks to ensure that the Name, Quantity and Price values submitted are not null.
If the form is valid, the JavaScript controller pushes the newItem onto the array of existing items, triggers the notification that the items value provider has changed, and resets the newItem value provider with a blank sObjectType of Camping_Item__c.


My answer - 
<aura:component >
<aura:attribute name="items" type="Camping_Item__c[]"/>
<aura:attribute name="newitem" type="Camping_Item__c[]"  default="{ 'sobjectType': 'Camping_Item__c',
                   'Quantity__c'=0, 'Price__c'=0}"/>
 <p>Name:
        <ui:inputText value="{!v.newitem.name}"/>
    </p>    
  <p>Packed:
        <ui:inputCheckbox value="{!v.newitem.Packed__c}"/>
     
    </p>    
  <p>Price:
        <ui:inputCurrency value="{!v.newitem.Price__c}"/>
    </p>
    <p>Quantity:
        <ui:inputNumber value="{!v.newitem.Quantity__c}"/>
    </p>
</aura:component>


Error -

Challenge Not yet complete... here's what's wrong: 
The campingList component isn't iterating the array of 'items' and creating 'campingListItem' components.

Please share the correct solution.