Another Salesforce blog!!!

Salesforce, Apex

CALLING GENERIC BASE COMPONENT USING EXTENDS W/PARAMS


–Calling base component WITH passing params

<aura:component controller="XXXXX" extends="c:Base" >
   <lightning:select label="select instructor" 
                                  variant="label-hidden" 
                                  name="instructor"
                                  value="{!v.selectedInstructorId}"
                                  onchange="{!c.onInstructorChange}"
                                  >
                    <option value="">
                        select instructor
                    </option>
                    <aura:iteration items="{!v.instructors}" var="i">
                        <option value="{!i.Id}">
                            {!i.Name}
                        </option> 
                    </aura:iteration> 
                </lightning:select>
onInstructorChange : function(component, event, helper) {
		component.set('v.selectedDeliveryId','');
         
        var selInstructorId = component.get('v.selectedInstructorId');  
        
        if(component.get('v.selectedInstructorId') != '' && component.get('v.selectedInstructorId') != null) {
            helper.callServer(
                component,"c.getDeliveriesByInstructor", function(response) {
                    component.set('v.deliveries',response);
                },
                { 
                    instructorId : component.get('v.selectedInstructorId')
                }
            )
            helper.onFilterEvent(component);
        }
        else {
            component.set('v.deliveries',"");
        } 
        
	},

Leave a Reply

Your email address will not be published. Required fields are marked *

*