Salesforce Aura Get Field from Dom

Other than with aura: id we can retrieve an element from the Dom (example a field of a form) in this other way

        console.log('Nome campo selezionato: ' + event.getSource().get("v.fieldName"));
        console.log('Valore campo selezionato: ' + event.getSource().get("v.value"));

        component.find('field').forEach(function(f) {
            let fileName = f.get('v.fieldName')
            if(f.get('v.fieldName') != event.getSource().get("v.fieldName")){
                f.set('v.value', false)

Leave a Reply

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