0

How to pass picklist value from parent lwc to lightning combobox in child lwc. I am calling below child component(as shown in screenshot) from parent component.
enter image description here

Child component is called on handleRowACtion using below code

case 'View':
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {url: 'https://dev2022sb-adscardservices.cs210.force.com/ComenityBusinessCenter/s/account-lookup'
}
});

So my requirement is to pass "Account Number" as selected value for Search for Accountby.
Below code is used in child component for picklist
<lightning-combobox name="search_account" label="Search for Account by:"
                     placeholder="Select Option" value={value} options={searchAccountByOptions}
                     onchange={handleChange}></lightning-combobox>

1 Answer 1

0

In Order to attain this you will first need to pass the value to the child which would then place it in the combobox.

This link shows how to pass values to children components

https://www.sfdckid.com/2020/08/api-property-lightning-web-component.html

you would then use the name of the variable declared as api, in your lightning-combobox markup

1
  • Welcome to Salesforce SE! While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Commented Mar 22, 2022 at 0:07

You must log in to answer this question.

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