[ALOY-522] Allow <View> to load custom view from a module
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-04-12T23:03:10.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 08 |
Components | XML |
Labels | notable, qe-testadded |
Reporter | Jeff Haynie |
Assignee | Tony Lukasavage |
Created | 2013-02-17T08:09:07.000+0000 |
Updated | 2014-06-22T13:21:14.000+0000 |
Description
If you want to use Alloy to load a custom view from a module, you have to do it in JavaScript manually in your controller and add to the view hierarchy. Would be nice to be able to do it with XML. (request from TiTokyo)
PR - https://github.com/appcelerator/alloy/pull/110
This will be implemented as such
<Alloy>
<Window>
<!--
"module" your UI module's ID.
"method" is the create method use to create an
instance of your UI module. "createView" will be
used if none is specified
-->
<Module id="paint" module="ti.paint" method="createPaintView"/>
</Window>
</Alloy>
Resolved in: https://github.com/appcelerator/alloy/commit/c82e238d868a9ef3c96c653a96104f82d49111a9
And yes Mads, the
Sweet!
seeing an error with this: Alloy 1.1.3-alpha XML:
[~bgrantges] you're using the wrong version of Alloy. This isn't available until 1.2.0, as per the fix version of the ticket.
My bad Tony - misread that as 1.1.2 - I will await the release! Thanks
Sample code available here: https://github.com/appcelerator/alloy/tree/master/test/apps/advanced/native_modules Verified working as expected. Environment: Titanium SDK 3.1.2.v20130718094558 Appcelerator Studio 3.1.2.201307191853 Alloy 1.2.0 Closing.