[ALOY-1000] Model Binding a View generates multiple calls to update the data of bound objects.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-28T16:06:53.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.5.0 |
Components | n/a |
Labels | qe-manualtest |
Reporter | Bert Grantges |
Assignee | Feon Sua Xin Miao |
Created | 2014-05-01T03:02:10.000+0000 |
Updated | 2014-08-22T23:27:48.000+0000 |
Description
I have a simple view that creates a Model instance and binds the model properties to two labels.
Code samples are here:
https://gist.github.com/grantges/28241878e3886c1cec51
When looking at the compiled JavaScript, you'll notice that the generated function to update the text properties on the bound Labels is being called twice.
Expectation
It should only be called once per label/property
[~fmiao] would you confirm this is still happening with Alloy 1.4? Thanks.
[~skypanther] it's still happening with Alloy 1.4.0-alpha4.
PR: https://github.com/appcelerator/alloy/pull/418 Test app: https://github.com/feons/alloy/tree/ALOY-1000/test/apps/testing/ALOY-1000 Functional Test: 1. Run the test app on iOS 2. Check Resources/iphone/alloy/controllers/index.js:
3. For each property, the update function is generated once.
PR tested and merged
Verified fix on: Mac OSX 10.9.4 Appcelerator Studio, build: 3.4.0.201408210941 Titanium SDK build: 3.4.0.v20140821144114 Titanium CLI, build: 3.4.0-dev Alloy: 1.5.0-dev iOS Simulator 7.1 Built the test to iOS and then checked Resources/iphone/alloy/controllers/index.js, the update function is generated once for each property.
Closing ticket.