I have the following piece of code in my lightning component

<aura:attribute name="wrapAccountList" type="wrapAccount[]"/>

    <aura:iteration items="{!v.wrapAccountList}" var="arItem" indexVar="index"> 
    <lightning:select name="rejectReasonPick" label="" aura:id="rejectrn" value="{!arItem.acc.rejectReason}" disabled="{!arItem.acc.Status__c == 'Closed'}">

Here if I provide disabled ="true" it is getting disabled. However, it is not getting disabled depending on the condition given above.

Is there any way to make disabled conditional. Here closed is a hard-coded value

arItem is var of a wrapper variable which is getting iterated in aura:iteration

Wrapper class code

public class wrapAccount {
        @AuraEnabled public Account_Request__c acc {get; set;}
        @AuraEnabled public Integer pageSize {get;set;}
        @AuraEnabled public Integer page {get;set;}
        @AuraEnabled public Integer total {get;set;}
        @AuraEnabled public Boolean selected {get; set;}
        @AuraEnabled public String rejectReason {get; set;}
        @AuraEnabled public Boolean isRequired {get; set;}
        public wrapAccount(Account_Request__c a) {
            acc = a;
            selected = false;
  • can you post declaration of wrapAccountList as well ? and apex code related to in, structure of this wrapper – Oleksandr Berehovskyi Mar 22 '18 at 7:15
  • Try to print Status__c and see what did you get here. – Tushar Sharma Mar 22 '18 at 7:44
  • Status__c is printing correctly. but it is not getting disabled – Rimii Mar 22 '18 at 7:57
  • disabled="true".. TRY this first.. is it disabling at all ?? – amidstCloud Mar 22 '18 at 8:23
  • It was not an issue with th code all. There was a mistake with the status value. My appologies. Thanks everyone for working on it. – Rimii Mar 22 '18 at 8:37

Your Answer

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

Browse other questions tagged or ask your own question.