[TIMOB-10298] BlackBerry: KitchenSink doesn't open any view the second time on device
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-04T01:35:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 12 BB, 2013 Sprint 12, Release 3.2.0 |
Components | BlackBerry |
Labels | n/a |
Reporter | Hranush Mezhlumyan |
Assignee | Russell McMahon |
Created | 2012-08-02T02:20:46.000+0000 |
Updated | 2014-06-19T12:42:59.000+0000 |
Description
KitchenSink doesn't open any view the second time on device.
It is reproducible in the sdk with the following githash number: githash=33051bf .
Steps to reproduce:
Step1. Launch KitchenSink
Step2. Open e.g. "controls_win_title"
STep3. Click on e.g. "Activity Indicator"
Step4. Go back by clicking "Back" button in the left below corner
Step5. CLick again and again on "Activity Indicator"
Actual Result: No any reaction
Step6. You can click any other view, e.g. "Slider"
Step7. Go back to the list (or even going back to Tab list and returning to the "controls_win_title" list which works fine doesn't matter how much time you go back and click it again)
STep8. Click again "Activity Indicator" or "Slider"
Actual Result: No any reaction
Expected result: in STep5 and Step8 we should see the corresponding tabs opened.
Solution to overcome: You can only open the "Activity Indicator" or "Slider" after closing and opening KitchenSink again.
I have done a small investigation and here are it's results. Added some logging information in Resources\ui\ControlsWindow.js - modified tableView.addEventListener as tableview.addEventListener('click', function(e) { if (e.rowData.test) { Titanium.API.info('Requireing corresponding file: ' + e.rowData.test); var ExampleWindow = require(e.rowData.test); Titanium.API.info('title = ' + e.rowData.title); Titanium.API.info('Self object type ' + Object.prototype.toString.call(self)); Titanium.API.info('Self object has containingTab property: ' + (typeof(self.containingTab) !== 'undefined')); Titanium.API.info('self.containingTab type ' + Object.prototype.toString.call(self.containingTab)); Titanium.API.info('Iterating over self'); for (var key in self) { Titanium.API.info(key + " -> " + self[key]); } Titanium.API.info('----------------'); var win = new ExampleWindow({ title:e.rowData.title, containingTab:self.containingTab, tabGroup:self.tabGroup }); Titanium.API.info('Windows created'); self.containingTab.open(win,{animated:true}); Titanium.API.info('windows opened'); } }); Here is the log output: NavigatorPrivate::handleWindowStateEvent - fullscreen [INFO]:Requireing corresponding file: ui/common/controls/button [INFO]:title = Button [INFO]:Self object type [object Object] [INFO]:Self object has containingTab property: true [INFO]:self.containingTab type [object Object] [INFO]:Iterating over self [INFO]:---------------- [INFO]:Windows created [INFO]:windows opened [INFO]:Requireing corresponding file: ui/common/controls/button [INFO]:title = Button [INFO]:Self object type [object Object] [INFO]:Self object has containingTab property: true [INFO]:self.containingTab type [object Object] [INFO]:Iterating over self [INFO]:---------------- TypeError: object is not a function [INFO]:Requireing corresponding file: ui/common/controls/button_state [INFO]:title = Button States [INFO]:Self object type [object Object] [INFO]:Self object has containingTab property: true [INFO]:self.containingTab type [object Object] [INFO]:Iterating over self [INFO]:---------------- [INFO]:Windows created [INFO]:windows opened [INFO]:Requireing corresponding file: ui/common/controls/button_state [INFO]:title = Button States [INFO]:Self object type [object Object] [INFO]:Self object has containingTab property: true [INFO]:self.containingTab type [object Object] [INFO]:Iterating over self [INFO]:---------------- TypeError: object is not a function [INFO]:Requireing corresponding file: ui/common/controls/button [INFO]:title = Button [INFO]:Self object type [object Object] [INFO]:Self object has containingTab property: true [INFO]:self.containingTab type [object Object] [INFO]:Iterating over self [INFO]:---------------- TypeError: string is not a function [INFO]:Requireing corresponding file: ui/common/controls/button [INFO]:title = Button [INFO]:Self object type [object Object] [INFO]:Self object has containingTab property: true [INFO]:self.containingTab type [object Object] [INFO]:Iterating over self [INFO]:---------------- TypeError: string is not a function [INFO]:Requireing corresponding file: ui/common/controls/button_state [INFO]:title = Button States [INFO]:Self object type [object Object] [INFO]:Self object has containingTab property: true [INFO]:self.containingTab type [object Object] [INFO]:Iterating over self [INFO]:---------------- TypeError: string is not a function
This is a bug with the caching of the result of running js code in the require implementation. I commented out the code to use the cached value as a workaround for now. The result is originally a function object, but when retrieved from the cache, it is no longer of type function. I didn't investigate further.