1

Trying to set dual list box value getting below error **Uncaught (in promise) TypeError: this.value.forEach is not a function at ie.get computedSelectedList [as computedSelectedList]**

HTML

<div class="tableInfo" style="overflow-x:auto;">
   <table
      class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered">
      <thead>
         <tr class="slds-line-height_reset">
            <th class="" scope="col">
               <div class="slds-truncate" title="">
               </div>
            </th>
            <th class="" scope="col">
               <div class="slds-truncate" title="Rule">
                  Rule
               </div>
            </th>
            <th class="" scope="col">
               <div class="slds-truncate" title="Rule">
                  Notification Type
               </div>
            </th>
            <th class="" scope="col">
               <div class="slds-truncate" title="">
               </div>
            </th>
            <th class="" scope="col">
               <div class="slds-truncate" title=" ">
               </div>
            </th>
         </tr>
      </thead>
      <tbody>
         <template for:each={getSchedulerDetails} for:item="it"
            for:index="index">
            <tr key={it.recId} class="slds-hint-parent">
               <td data-label={it.rowNum} scope="row">
                  <div class="slds-truncate"
                     title={it.rowNum}>
                     {it.rowNum}
                  </div>
               </td>
               <td data-label={it.rule} scope="row">
                  <div class="slds-truncate" title={it.rule}>
                     {it.rule}
                  </div>
               </td>
               <td data-label={it.rule} scope="row">
                  <div class="slds-truncate" title={it.rule}>
                     {it.notificationType}
                  </div>
               </td>
               <td scope="row">
                  <div class="slds-truncate">
                     <lightning-button-icon
                        data-id={it.recId}
                        data-schedulertype={it.schedulerType}
                        data-schedulerdate={it.schedulerDate}
                        data-schedulerwhen={it.schedulerWhen}
                        data-noofdate={it.noOfDate}
                        data-notificationtype={it.notificationType}
                        icon-name="utility:edit"
                        variant="brand"
                        alternative-text="edit"
                        onclick={handleonclickEditRuleModal}>
                     </lightning-button-icon>
                  </div>
               </td>
               <td scope="row">
                  <div class="slds-truncate">
                     <lightning-button-icon
                        icon-name="utility:delete"
                        data-id={it.recId} variant="brand"
                        alternative-text="delete"
                        onclick={handleonclickDeleteRuleModal}>
                     </lightning-button-icon>
                  </div>
               </td>
            </tr>
         </template>
      </tbody>
   </table>
</div>

JS

handleonclickEditRuleModal(event) {
this.selectNotificationType = event.currentTarget.dataset.notificationtype;
        console.log(this.selectNotificationType);
}

Trying to add selectNotificationType value in the below dual listbox

<lightning-dual-listbox id="selectOptions" name="Select Options" label=" "
                                            source-label="Notification Types"
                                            selected-label="Selected Notification Types" value={selectNotificationType}
                                            options={notificationTypesOptions} onchange={handleChangeDualPicklist}>
                                        </lightning-dual-listbox>

APEX

    List <String> ptlist = new list <string>();
            if(sch.emitcs2__Notification_Type__c !=null){
                List<String> lstnotf = sch.emitcs2__Notification_Type__c.split(';');                
                for(string pt: lstnotf ){
                    system.debug('pt' + pt);
                    ptlist.add(pt);
                }                 
                wrapper.notificationType = ptlist;
            }

Can you please help what I am doing wrong here.

0

You need to wait for the data to load. Something like this:

<lightning-dual-listbox if:true={selectNotificationType} ...
1
  • Still getting same Error <lightning-dual-listbox id="selectOptions" if:true={selectNotificationType} name="Select Options" label=" " source-label="Notification Types" selected-label="Selected Notification Types" value={selectNotificationType} options={notificationTypesOptions} onchange={handleChangeDualPicklist}> </lightning-dual-listbox> Apr 19 '21 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.