Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20612] Windows: postlayout events not firing

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-03-23T23:28:29.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 5.3.0
ComponentsWindows
Labelsqe-5.3.0
ReporterRakhi Mitro
AssigneeKota Iguchi
Created2016-03-22T05:37:32.000+0000
Updated2016-05-02T23:44:17.000+0000

Description

An event listener is added for a postlayout event on a view, and then a property on the view is changed (eg height or top). The callback for the event listener does not get executed. *Test Code:* reporter’s sample [code](https://www.dropbox.com/s/s4iev5w66vmct5a/accessCase%20%281%29.zip?dl=0). *Test Environment:* Appcelerator Command-Line Interface; 5.2.0 Operating System: Microsoft Windows 8.1 Enterprise Node.js: 0.12.7 npm: 2.11.3 Appcelerator CLI Installer = 4.2.3 Core Package = 5.2.0 Titanium CLI:5.0.6 TI SDK:5.4.0.v20160307212310 *Test Steps:* * Import the app * Run it in a windows device * Click the blue box ,it is getting changed and check that the callback for the event listener(post layout) does not get executed *Test Results:*
]  Running MSBuild on solution: C:\Users\titanium\.titanium\vsbuild\AlloyTestWindows\phone.ARM\AlloyTestWindows.sln
[INFO]  Writing build manifest: C:\Users\titanium\.titanium\vsbuild\AlloyTestWindows\build-manifest.json
[INFO]  Copying results back to project build directory
[INFO]  Finished building the application in 1m 12s 251ms
[INFO]  Finished building the application in 1m 12s 251ms
[INFO]  Installing and launching the application
[INFO]  Project built successfully in 1m 14s 918ms

[INFO]  Finished launching the application
[INFO]  Waiting for app to connect to log relay

Comments

  1. Kota Iguchi 2016-03-23

    I was able to reproduce this. postlayout is fired once when app is loaded, but after that, not fired even when view size is changed.
       var win = Titanium.UI.createWindow({backgroundColor:'green'});
       var view = Titanium.UI.createView({
           backgroundColor: 'red',
           width: 200,
           height: 200
       });
       var view2 = Titanium.UI.createView({
           backgroundColor: 'green',
           width: '80%',
           height: '80%',
       });
       var view3 = Ti.UI.createView({
           backgroundColor: 'gray',
           width: '80%',
           height: '80%'
       });
       
       view2.add(view3);
       view.add(view2);
       
       view.addEventListener('postlayout', function () {
           Ti.API.info('view postlayout');
       });
       view.addEventListener('click', function () {
           view.width  = view.width  * 0.9;
           view.height = view.height * 0.9;
       });
       view2.addEventListener('postlayout', function () {
           Ti.API.info('view2 postlayout');
       });
       view3.addEventListener('postlayout', function () {
           Ti.API.info('view3 postlayout');
       });
       
       win.add(view);
       win.open();
       
  2. Kota Iguchi 2016-03-23

    https://github.com/appcelerator/titanium_mobile_windows/pull/589
  3. Gary Mathews 2016-03-23

    5_3_X: https://github.com/appcelerator/titanium_mobile_windows/pull/590
  4. Harry Bryant 2016-05-02

    Verified as fixed, postlayout events are fired for each click, after the initial one. Tested on: Windows 10 Pro Windows Phone 10.0 (Microsoft Lumia 640 LTE) Appc Studio: 4.6.0.201604290815 Ti SDK: 5.3.0.v20160430043601 Appc NPM: 4.2.5-5 Appc Core: 5.3.0-40 Node: v4.4.2 *Closing Ticket.*

JSON Source