• Mike Vermace
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hey guys!!
Anyone there completed this challenge?
I've tried a number of ways and finally succeeded by writing the folloeing code:

campingListItem.cmp:

<aura:component >
    <aura:attribute name="item" type="Camping_Item__c" required="true" />
    <aura:attribute name="disabled1" type="Boolean" default="false" />
    <p><ui:inputCheckbox value="{!v.item.Packed__c}"/></p>
    <ui:button label="Packed!" press="{!c.packItem}" disabled="{!v.disabled1}"/>
</aura:component>

campingListController.js

({
    packItem : function(component, event, helper) {
        component.set("v.item.Packed__c",true);
        component.set("v.disabled1", true);
    }
})
It's working fine on my browser but on checking challenge, I get:
Challenge Not yet complete... here's what's wrong:
The campingListItem JavaScript controller isn't disabling the button correctly.

Can't understand what's going wrong. Also tried by other ways like:
component.set(true, event.getSource().get("v.disbaled"));
OR
component.set(event.getSource().get("v.disbaled"), true);
ETC..
None of them seems to be working fine.