function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
d.tejdeep@nicomatic.ind.tejdeep@nicomatic.in 

Event.getParam value Duplicating multiple times?

Parent Action JS :
 
// set call back 
action.setCallback(this, function(response) {
    var state = response.getState();
    if (state === "SUCCESS") {
        var qli=response.getReturnValue();
        var key=0;
        for (key in qli){
            var qliindexno=qli[key].Id;
            var qlisaved=qli[key].QliRowNum__c;                    
            var appEvent = $A.get("e.c:ClearValues");
            appEvent.setParams({ "param1" : qliindexno});
            console.log('NOuyd123');
            appEvent.fire(); 
            console.log('NOuyd');
            key++;
        }
    }
});


child component :
 
<aura:handler  event="c:ClearValues" action="{!c.saveBatchDetails}"/>

Child action :
 
saveBatchDetails: function(component,event,helper){
           console.log("calling updateRaces in ListRaceController");
           var param1 = event.getParam('param1');
           console.log(param1);

User-added image

If we remove
var param1 = event.getParam('param1');
           console.log(param1);
User-added image


Event.getparam is duplicating multiple time if we remove the event.getparam