[TIMOB-15091] iOS: Cannot use a module when using a listview childtemplates
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | TiAPI |
Labels | Q3, android, demo_app, engArch, ios, listview, roadmap2019 |
Reporter | Braden Powers |
Assignee | Vijay Singh |
Created | 2013-07-18T02:31:24.000+0000 |
Updated | 2020-02-06T22:33:16.000+0000 |
Description
The issue is that I cannot use the styled label module that Appcelerator built in a ListView. The type for the ChildTemplates is expecting a string and cannot recognize the module. Please Advise.
Attachments
File | Date | Size |
---|---|---|
Simulator Screen Shot - iPhone 6s - 2018-01-24 at 10.47.19.png | 2018-01-24T09:49:12.000+0000 | 46146 |
Hello Braden, From your bug report you are missing a few pieces of information that are necessary to quickly realize a solution for you. Please provide a simple test case that demonstrates the issue you are describing as well as steps to reproduce such issue. Please refer to: https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report For more information on what is necessary in a bug report. Thank you, Carter
I have a similar issue. Don't see the necessity for a test case or steps to reproduce. This is not a bug but an oversight. I don't know how you could require more than to know you cannot use anything but Ti.UI components with ListView.
[~bradenpowers], [~btoc007], we are lacking docs that make what is and isn't supported obvious to developers, which is resulting in this confusion. If you had access to the appropriate documentation this would be better listed as a feature request as it is simply not implemented yet. [~ingo], [~bhatfield], can we work on adding a clear list in the ListView API docs and guides that indicate specifically which UI components are supported? This is not the first time (even today) that I'm seeing confusion among developers due to the lack of an explicit list of supported UI components for ListView items.
I was looking through the documentation and it appears that it is still not possible to the use the module with a listview. Is this true? Do I have to submit a feature request?
This is currently not supported. Please convert this ticket to a feature request.
[~bradenpowers] while it may seem obvious, including a proposed example of how you think it should be made possible would be helpful. Just a short clear example of how you'd like to be able to use this functionality once it is implemented.
I see there hasn't been recent activity on this, so here are my two cents. I know nothing about internals of the ListView implementation, however. Many Titanium users badly need to include native module-created view objects in list templates. Examples: - Styled labels - Admob banners - etc Example of how I'd like to build a child template for a banner element, to be then composed in a more complex row: var AdMob = require('ti.admob'); var bannerTemplate = function() { banner = { // type: 'Ti.UI.View', creationMethod: AdMob.createView, bindId: 'banner', properties: { width: 300, height: 250, publisherId: "whatever" }, events: { didReceiveAd: function(e) { }, didFailToReceiveAd: function(e) { }, }; return banner; } Basically, instead of specifying a string with the Ti type, we would provide the factory creator method, that could then be passed the 'properties' as params at row instantiation time. Assuming of course that: - the provided creationMethod is anything (module method or even js func) that returns a view or viewproxy; - the native module is able to react to changes of its properties, if as I suspect ListView cell reuse is something like a big tree of applyProperties (ti.admob should be adapted for this). The above may be enough for many of the use cases I've seen in Q&A and tickets.
Please reconsider the priority on this, there are numerous Q&A's on this: http://stackoverflow.com/questions/24713059/using-titanium-module-with-listview-template https://developer.appcelerator.com/question/154972/styledlabel-module-in-a-listview http://developer.appcelerator.com/question/176076/using-module-with-listview-template http://developer.appcelerator.com/question/176087 http://noodlecode.net/2014/04/use-view-from-custom-module-inside-titanium-listviewitem/ and more.... Thanks.
Hey guys, quick update on this: Would it be a suitable solution to introduce a "module" key in the item-template that would define the name of the module? Doing that, we could construct the internal proxy like all others then, for example a map inside a ListView: !Simulator Screen Shot - iPhone 6s - 2018-01-24 at 10.47.19.png|thumbnail! Code:
The SDK-change to realize this is quite small, so this could be in future versions of the SDK. The only problem would be to know the actual name of the module root-class, which can differ from the actual name of the module because its generated by the module ID and not module name.
iOS-PR: https://github.com/appcelerator/titanium_mobile/pull/9767 Example:
*Note*: This is only the iOS PR! To complete this request, we would need to do the same for Android.
Moving out of 7.1.0 due to missing the Android parity PR.
Can someone tell me why this was unassigned although in review? And no fix version? 17+ watchers should be sufficient enough to at least schedule this.