Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

Questions tagged [aura-iteration]

Asked by Anu Rhea Apr 24, 2021 989 views 2 answers
Share

About this question

How to get the selected value by dynamic id in Aura Component during aura: iteration? I'm in trouble getting the selected picklist value.using the below code, multiple select boxes are displayed by iteration. each selection has a dynamic id. now by using the dynamic id. I want to get the selected value of each select box. As per my code, it returns undefined.

hope someone helps me.

cmp File

js file
 
doSave1: function(component, event, helper) {        
    var inputfield = component.find("textfield").get("v.value");
    var indexvar = document.getElementsByClassName("icon_image_canvas").length;
    var imgURL = [];
    
    for(var i=0; i < indexvar>        var tempCanvas =  document.getElementById( "targetIcon_" + i );
        var statusName = component.find("statusName_" + i).get("v.value");
        //var statusName = document.getElementsByClassName( "statusName_" + i )[0] ;
        alert(statusName);
        console.log("test: "+ statusName);
        
        var _imgURL = tempCanvas.toDataURL("image/png");
        imgURL.push(_imgURL.split(',', 2)[1]);
    }
    
        var action = component.get("c.createTorikago");        
        action.setParams({torikagoObj : component.get('v.torikagoSetupObj')});
        //action.setParams({torikagoObj : component.get('v.torikagoSetupObj'), imgURL : imgURL});
        
        action.setCallback(this,function(response){
            helper.doResponseProcess(component, response, 5);  
        });
        $A.enqueueAction(action);
    
},

Thanks in advance.

Your answer

2 Answers

Bekeanloinse Latest answer

Answered on Oct 9, 2024

I got the point of the story, it's great that you gave me a lot of useful wordle 2 knowledge.

Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.