Tips for Passing the Lightning Web Components Specialist Superbadge – Challenge 4
This post describes about the Lightning Web Components Specialist Superbadge Challenge 4 Guide (Tips and Guidelines).
Lightning Web Components Specialist Superbadge Challenge 4: Build the component boatSearchForm
To Pass the Lightning Web Components Specialist Superbadge Challenge 4, require to create LWC component called “boatSearchForm“.
After Completing the Lightning Web Components Specialist Superbadge Challenge 4: Build the component boatSearchForm, you’ll be able to learn:
- Creating LWC Component.
- Lightning-combobox and passing the attributes
- Import the apex methods in LWC components
- Use wire service to call apex method – https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex
- Create Custom Events and Dispatch
- When @track is required – https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_lwc_track.htm
- Array map function in Javascript – https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
Possible Errors:
We can’t find the component boatSearchForm. Make sure the component was created according to the requirements.
We can’t find the correct settings set for the lightning-combobox in the component boatSearchForm HTML. Check that the component was created according to the requirements, including the correct function for the onchange event, correct options, and values, using the correct case sensitivity.
We can’t find the required imports in the component boatSearchForm JavaScript file. Check that the component was created according to the requirements, including the imports from Lightning Web Components.
We can’t find the required imports in the component boatSearchForm JavaScript file. Make sure the component was created according to the requirements and includes the getBoatTypes import from the Apex method BoatDataService.getBoatTypes().
We can’t find the variable searchOptions instantiated with the right decorator in the component boatSearchForm JavaScript file. Make sure the component was created according to the requirements, including the proper case-sensitivity.
We can’t find the wire service provisioned function boatTypes with the data property in the component boatSearchForm JavaScript file. Make sure the component was created according to the requirements, including the proper case-sensitivity.
We can’t find the return set properly in the boatTypes function in the component boatSearchForm JavaScript file. Make sure the component was created according to the requirements, including the right labels and values to populate the searchOptions, and the proper case-sensitivity.
Tips/Guide to passing the LWC Challenge 4:
- Create boatSearchForm LWC Components as per instructions
- Add proper name, value, options, onchange method in the lightning-combobox in the boatSearchForm HTML.
- Read Carefully in the boatSearchForm.js file and add the necessary apex class (Import LightningElement, Apex Class, add right decorator and wire services like @track, @wire decorators and Create Custom Events and Dispatch the Events).
- Return the Name & Id in the searchOptions array to display the boat information in the combobox field value and label.
- Create CustomEvent with passing the selectedBoatTypeId and dispatchEvent which created
Reference Link:
Lightning-combobox in LWC – https://developer.salesforce.com/docs/component-library/bundle/lightning-combobox/example
Create and Dispatch Events – https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.events_create_dispatch
Array Map Function in Javascript – https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
Refer the following post about the Tips for Passing the Lightning Web Components Specialist Superbadge Challenges:-
- Lightning Web Components Specialist Challenge 1
- Lightning Web Components Specialist Challenge 2
- Lightning Web Components Specialist Challenge 3
- Lightning Web Components Specialist Challenge 4
- Lightning Web Components Specialist Challenge 5
- Lightning Web Components Specialist Challenge 6
- Lightning Web Components Specialist Challenge 7
- Lightning Web Components Specialist Challenge 8
- Lightning Web Components Specialist Challenge 9
- Lightning Web Components Specialist Challenge 10
- Lightning Web Components Specialist Challenge 11
- Lightning Web Components Specialist Challenge 12
- Lightning Web Components Specialist Challenge 13
- Lightning Web Components Specialist Challenge 14
- Lightning Web Components Specialist Challenge 15
- Lightning Web Components Specialist Challenge 16
- Lightning Web Components Specialist Challenge 17
- Lightning Web Components Specialist Challenge 18
The post Tips for Passing the Lightning Web Components Specialist Superbadge – Challenge 4 appeared first on TheBlogReaders.com.