I have a page with the following two lightning components inside a for:each -
<template for:each={selectedConfig.attributes} for:item="attrib">
<template if:false={attrib.isPicklist}>
<lightning-input type={attrib.webType}
variant="label-hidden"
name={attrib.externalName}
onchange={handleValueUpdate}
placeholder={attrib.placeHolder}
pattern={attrib.textPattern}
value={attrib.value}>
</lightning-input>
</template>
<template if:true={attrib.isPicklist}>
<lightning-combobox name={attrib.externalName}
value={attrib.value}
onchange={handleValueUpdate}
options={attrib.picklistValues}>
</lightning-combobox>
</template>
</template>
The lightning-input component works great. The lightning-combobox does not. The combobox displays but does not show any default value, only the placeholder text. Also, when I click on the combobox it will not show me the list of values or allow me to select anything else.
It's like the combobox is readonly!
Client side javascript controller is as follows -
import getSelectedConfig from '@salesforce/apex/myUIController.getSelectedConfig';
export default class myUIProcess extends LightningElement {
@track error;
@track selectedConfigOption;
@track selectedConfig;
@wire(getSelectedConfig, { processName: '$selectedConfigOption' })
wiredSelectedConfigOption({ error, data }) {
if (data) { this.selectedConfig = data; this.error = undefined;}
else if (error) { this.error = error; }
}
handleValueUpdate(event) {
console.log('Do stuff.');
}
}
A few thoughts -
- It works great for the input field so in my mind all the attrib data is available.
- The attrib data is not read-only as I am able to input values (using the lightning-input component) and the values are retrieved and handled as expected.
- I have used debugging on the back end Apex controller and the attrib.picklistValues are being picked up and returned as expected.
- The attrib.getPicklistValues() method on the backend controller is @AuraEnabled (cacheable=true)
Anybody have an idea what the issue might be?