Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stephenpstanley opened this issue May 10, 2021 · 0 comments

Comments

@stephenpstanley
Copy link

stephenpstanley commented May 10, 2021

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);
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant