Skip to content

Unable to retrieve selected options when embedding this component in LWC #1

Open
@stephenpstanley

Description

@stephenpstanley

I've embedded this in an LWC as below:

I can pass channelValues and channelNames in happily enough and present the option to the user but I'm unable to retrieve the selected options in the parent component

On exit from the component channelValues and ChannelNames are unchanged from the values passed in
The onchange handler returns an error when it gets invoked as being an invalid handler to use in this context
I've tried adding the notification handler in my parent component as per this documentation https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.events_handling but the event never gets triggered

My parent component handler has the following code (I've tried with and without the 'template' object):
constructor() {
super();
this.addEventListener('notification', this.handleNotification);
this.template.addEventListener("notification", this.handleNotification);
}

handleNotification = (event) => {
console.log("handleNotification - target:", target.value);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions