[ALOY-903] Alloy: __parentSymbol property missing for widgets in TableView

GitHub Issuen/a
ResolutionWon't Fix
Resolution Date2013-12-17T19:22:43.000+0000
Affected Version/sn/a
Fix Version/sn/a
Labels1.3.0, alloy
ReporterFokke Zandbergen
AssigneeTony Lukasavage


Since Alloy 1.3.0-cr Widgets (and Requires) in TableViews don't get the __parentSymbol property anymore. This causes widgets like [infiniteScroll](https://github.com/fokkezb/nl.fokkezb.infiniteScroll/) to crash the app. For effective widgets it is essential for them to know about their context.

To reproduce

1. Run the attached project 2. See how it crashes 3. Open the Resources/iphone/alloy/controllers/index.js file to see that indeed the __parentSymbol property is missing. 4. Try again with an earlier version of Alloy and see it working.




  1. Fokke Zandbergen 2013-12-17 Same for my [pullToRefresh](https://github.com/fokkezb/nl.fokkezb.pullToRefresh/) widget. For both I've released a version that has a manual workaround.
  2. Ingo Muschenetz 2013-12-17 Fokke, can you plead let us know which version of Alloy first shows the problem? What is the manual workaround? [~tlukasavage], FYI
  3. Tony Lukasavage 2013-12-17 __parentSymbol was never meant to be a public API, hence the [double underscores](http://docs.appcelerator.com/titanium/latest/#!/guide/Alloy_Best_Practices_and_Recommendations-section-36735073_AlloyBestPracticesandRecommendations-NamingConventions) and no mention in the documentation. I can take a look, but I'm not sure that this will be able to be resolved for 1.3.0.
  4. Tony Lukasavage 2013-12-17 As stated in the comments, __parentSymbol is not intended to be used directly by developers, and probably doesn't do exactly what you think it does. The instances where it is undefined are by design. __parentSymbol is passed through controllers only when the parent/child UI parsers actually need them. The manner in which Ti.UI.TableView is parsed causes it not to pass __parentSymbol as TableView and its children do not have the normal add()/remove() relationship that __parentSymbol is meant to preserve. I'm closing this as "won't fix". You can, however, open a feature request for a true public API that does what you _think_ __parentSymbol does, which I'm assuming you think it is _always_ a reference to the current XML UI component's direct parent, which is not currently the case.
  5. Fokke Zandbergen 2013-12-17 [~ingo] the workaround is to instruct people to manually call an init method in the controller, passing the object to act upon as its parameter. I think this is against the idea of self-configuring widgets so I will create a ticket to request __parentSymbol to be formalized/reformatted as a property for developers to use.
  6. Fokke Zandbergen 2013-12-18

JSON Source