You need to sign in to do that
Don't have an account?
Rose Marie Foster
I got this error "Challenge Not yet complete... here's what's wrong:
The campingListItem JavaScript controller doesn't have a 'packItem' handler function." when I check my code below:
Component:
<aura:component >
<aura:attribute name="item" type="Camping_Item__c" required="true"/>
<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>
<ui:button label="Packed!" press="{!c.packItem}"/>
</aura:component>
CONTROLLER:
({
packItem : function(component, event, helper) {
var checkbox = component.get("v.item",true);
checkbox.Packed__c = true;
component.set("v.item",checkbox);
event.getSource().set('v.disabled', true);
}
})
What did I miss? Sorry I am new to coding and still learning my way around it. If anyone could help me I would really appreciate it.
Challenge Not yet complete... here's what's wrong: The campingListItem JavaScript controller doesn't have a 'packItem' handler function."
I got this error "Challenge Not yet complete... here's what's wrong:
The campingListItem JavaScript controller doesn't have a 'packItem' handler function." when I check my code below:
Component:
<aura:component >
<aura:attribute name="item" type="Camping_Item__c" required="true"/>
<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>
<ui:button label="Packed!" press="{!c.packItem}"/>
</aura:component>
CONTROLLER:
({
packItem : function(component, event, helper) {
var checkbox = component.get("v.item",true);
checkbox.Packed__c = true;
component.set("v.item",checkbox);
event.getSource().set('v.disabled', true);
}
})
What did I miss? Sorry I am new to coding and still learning my way around it. If anyone could help me I would really appreciate it.
Below code worked for me.
Hope this helps you!
Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
Thanks and Regards
Sandhya