0

I have got this lightning:inputField in my component.

<lightning:inputField aura:id="isPrimary" fieldName="SBQQ__Primary__c" value="{!v.quoteRecord.SBQQ__Primary__c}" onchange="{!c.handleCheck}"/>

With a boolean value, it never gets updated on the onchange event.

I tried to debug into it. But component.find("isPrimary").get("v.value") always return the default value. component.find("isPrimary").get("v.checked") returns undefined. I have also tried changing value into checked which doesn't work as well.

Any walkaround for this?

1 Answer 1

0

Just remove the value...

<lightning:inputField aura:id="isPrimary" fieldName="SBQQ__Primary__c" onchange="{!c.handleCheck}"/>

And in your Javascript ...

handleCheck: function (component, event) {
    let quoteRecord = component.get('v.quoteRecord');
    quoteRecord.SBQQ__Primary__c = component.find("isPrimary").get("v.value");
    component.set('v.quoteRecord', quoteRecord);
}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.