ExamGecko
Question list
Search
Search

Question 119 - Certified B2B Commerce Developer discussion

Report
Export

A developer has made a component with a lightning combobox in the follow! markup. To handle changes on the combobox, what should replace <CHANGE FVENT>?

A.
{event:handleChange}
Answers
A.
{event:handleChange}
B.
javascript:void(0);handleChange();
Answers
B.
javascript:void(0);handleChange();
C.
{handleChange()}
Answers
C.
{handleChange()}
D.
{handleChange}
Answers
D.
{handleChange}
Suggested answer: D

Explanation:

To handle changes on the combobox, the developer should replace <CHANGE EVENT> with {handleChange}. The handleChange is a function that is defined in the JavaScript file of the Lightning web component and is invoked when the value of the combobox changes. The developer can use this function to perform custom logic or actions based on the selected value of the combobox, such as updating other components or properties, calling Apex methods or services, or firing events. The developer can use the onchange attribute to bind the handleChange function to the combobox element in the HTML file of the Lightning web component. The onchange attribute is an HTML attribute that specifies a function to be executed when the value of an element changes. {event:handleChange} is not a valid way to handle changes on the combobox, as it is not a valid syntax for binding a function to an element. javascript:void(0);handleChange(); is not a valid way either, as it is not a valid syntax for binding a function to an element. {handleChange()} is not a valid way either, as it is not a valid syntax for binding a function to an element. Salesforce

Reference: Lightning Web Components Developer Guide: Handle Events, Lightning Web Components Developer Guide: Communicate with Properties, Lightning Web Components Developer Guide: lightning-combobox

asked 23/09/2024
PATRICK KOUOBOU
29 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first