1

When i change the value in my Lightning Component for Credit_Allocation__c, the new value is not getting saved and as soon as mouse out to the column, Credit_Allocation__c value gets changes to it's previous value.

member is basically a wrapper here, inside that wrapper I have a reference to Booking object that I am trying to update.

I am using wrapper as I need to maintain some boolean field like is selected, isdelete etc.

<aura:iteration var="member" items="{!v.teamMembers}" indexVar="index" >
    <ui:inputNumber value="{!member.booking.Credit_Allocation__c}" updateOn="change" />
</aura:iteration>

Can anyone help!!!! I have been trying to fix this from past 5 hours but no luck :( :(

2
  • Post the code and specify the exact line where it is erroring out . without code its not possible to say what the problem is
    – RedDevil
    Commented May 13, 2017 at 14:56
  • duh...my mistake, I did posted the code earlier but it didn't show up in question. I have edite ma question now.
    – Bhawna
    Commented May 14, 2017 at 15:58

1 Answer 1

0

Unfortunately, this is a Known Issue.

Your best bet is to modify the multi level object when you get it from the server and put the Credit_Allocation__c value on the member object itself.

Or when you get the data, make a new Array of objects perhaps just the memberid and the Credit_Allocation__c. That way you can sort them out before saving back to the server.

Eg incoming:

var membersLite = [];
var members = response.getReturnValue();
members.forEach(function(member){
  var memberLite = {};
  memberLite.memberid = member.Id;
  memberLite.creditAllocation = member.booking.Credit_Allocation__c;
  membersLite.push(memberLite);
});

Then save membersLite to an attribute and iterate on that.

When you save back to the server, you'll have to parse the membersLite Array, extract the Credit_Allocation__c and add it to the proper member.booking object - which you can find by using the stored memberid.

2
  • I was actually thinking of using a html input tag instead of using ui:inputNumber, and then bind the value of that input tag to Credit_Allocation__c. M trying it, it's not working though.
    – Bhawna
    Commented May 15, 2017 at 7:05
  • It would work if you used a data attribute containing the if of the record you wanted to modify. Then onchange you would find the correct record and manually update Commented May 15, 2017 at 7:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .