function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ssgmailssgmail 

Lightning Attribute Binding not working with custom classes after Summer'16

I am noticing that the bound variables are not being updated in Lightning after the Summer'16 update. This happens when the bound variables are properties of custom classes.
To illustrate the issue I have the following code which binds the property(name) of the custom class(group) to an input component( ui:inputText). You will notice that when you click on the button for the first time the expression "component.get("v.group").name" gives the updated value. But subsequent clicks still show the value from the first click as if after the first "get" the linkage between the inputtext and the base binding object is broken. 

My expectation is that expression component.get("v.group").name) will always give me the current value of the ui:inputText as it is bound to that field.

Below is the code:
1. Application:
<aura:application >
<c:testAttributeSetting />
</aura:application>

2. testAttributeTesting.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="group" type="Object" />
<ui:inputText aura:id="groupObjectNameId" label="linked to group.name" class="field" value="{!v.group.name}"/>
<ui:button class="btn" label="Submit" press="{!c.setOutput}"/> 
<div aura:id="msg">
<p>From group.name: <ui:outputText aura:id="oName2" value="{!v.group.name}"/></p>
</div>
</aura:component>

3. testAttributeTestingController.js
({
doInit : function(component, event, helper) {
var group = {name:"hello"};
component.set("v.group",group);

}, 
setOutput: function(component, event, helper) {
alert('component.get("v.group").name: (Displays first click value always)' + component.get("v.group").name);
alert('component.find("groupObjectNameId").get("v.value"): (Displays correct value)' + component.find("groupObjectNameId").get("v.value"));
alert('component.get("v.group.name"): (Displays correct value)' + component.get("v.group.name"));
}

})

You should be able to use the above to to recreate the issue. Appreciate if you let me know the results.
Please let me know if there is any issue with the code itself and how to fix this.
 
V. BezbozhnyiV. Bezbozhnyi
Hello, ssgmail

Do you resolve this problem or maybe you have some workaroung?