1

Hi I have created 2 lwc components From child i am passing Id and calling in parent. Once selected in parent i am not able to get value in parent.

child.js

const oEvent = new CustomEvent('lookupupdate',
                                    {
                                        'detail': {selectedRecord: value.Id}
                                    }
                        );
        this.dispatchEvent(oEvent);

parent.js

   HandleLookup(event){
console.log('Child in Parent' + event.detail);
this.selectedSourceId = event.detail;

}

parent.html

<c-source-lookuplwc onselected={HandleLookup}></c-source-lookuplwc> 

i am not getting console.log('Child in Parent' + event.detail); once selected record from child lwc

1 Answer 1

1

Your event is lookupupdate but your HandleLookup function is being called from the onselect event.

Try updating onselected={HandleLookup} to onlookupupdate={HandleLookup}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .