[ALOY-903] Alloy: __parentSymbol property missing for widgets in TableView
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Closed |
| Resolution | Won't Fix |
| Resolution Date | 2013-12-17T19:22:43.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Widgets |
| Labels | 1.3.0, alloy |
| Reporter | Fokke Zandbergen |
| Assignee | Tony Lukasavage |
| Created | 2013-12-17T08:27:44.000+0000 |
| Updated | 2014-01-06T07:09:40.000+0000 |
Description
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 theResources/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.
Attachments
| File | Date | Size |
|---|---|---|
| test.zip | 2013-12-17T08:27:44.000+0000 | 4307085 |
Same for my [pullToRefresh](https://github.com/fokkezb/nl.fokkezb.pullToRefresh/) widget. For both I've released a version that has a manual workaround.
Fokke, can you plead let us know which version of Alloy first shows the problem? What is the manual workaround? [~tlukasavage], FYI
__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.
As stated in the comments,
__parentSymbolis 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.__parentSymbolis 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__parentSymbolas TableView and its children do not have the normal add()/remove() relationship that__parentSymbolis 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___parentSymboldoes, 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.[~ingo] the workaround is to instruct people to manually call an
initmethod 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__parentSymbolto be formalized/reformatted as a property for developers to use.