You need to sign in to do that
Don't have an account?
Sangeetha Empowered
lightning challenge trailhead
Refactor the input form for camping list items into its own component and communicate with messages.
Replace the HTML form in the campingList component with a new campingListFormcomponent that calls the submitForm controller action when clicked.
The campingList component handles a c:addItemEvent event with the actionhandleAddItem in the JavaScript controller. The handleAdditem method saves the record to the database and adds the record to the items value provider.
The addItemEvent event is of type component and has a Camping_Item__c type attribute named item.
The campingListForm registers an addItem event of type c:addItemEvent.
The campingListFormController JavaScript controller calls the helper's createItem method if the form is valid.
The campingListFormHelper JavaScript helper creates an addItem event with the item to be added and then fires the event. It then resets the newItem value provider with a blank sObjectType of type Camping_Item__c.
Need the code for the above challenge
Replace the HTML form in the campingList component with a new campingListFormcomponent that calls the submitForm controller action when clicked.
The campingList component handles a c:addItemEvent event with the actionhandleAddItem in the JavaScript controller. The handleAdditem method saves the record to the database and adds the record to the items value provider.
The addItemEvent event is of type component and has a Camping_Item__c type attribute named item.
The campingListForm registers an addItem event of type c:addItemEvent.
The campingListFormController JavaScript controller calls the helper's createItem method if the form is valid.
The campingListFormHelper JavaScript helper creates an addItem event with the item to be added and then fires the event. It then resets the newItem value provider with a blank sObjectType of type Camping_Item__c.
Need the code for the above challenge
even though in the form I have registered created and fired the event all apparently successfully
<aura:handler name="addItem" type="c:addItemEvent" action="{!c.handleAddItem}" />
but without being able to save this line ( a line just like I have in a working expense app) I cannot complete the challenge. I get this stupid error that makes no sense as the addItem event is registered firing and working properly
Failed to save undefined: aura:handler has invalid name attribute value: addItem
Did you get your answer Sangeetha?