Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3807] Exceptions and events don't fire for Alloy views created via Tags and a CommonJS lib

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2016-06-21T18:26:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterJason Kneen
AssigneeShak Hossain
Created2016-06-09T15:50:02.000+0000
Updated2016-06-21T18:26:12.000+0000

Description

I tend to build custom tags, using the module="ui" attribute to point the create function toward a commonJS lib that handles the createThis, and createThat etc. Typically that means if I'm building a control, I would use classic Ti in the commonJS file and the return a view, button etc. In this example, I was trying to use an alternative where I could create a controller, view, style file in a subfolder e.g. ui/slider and then invoke that from a custom tag so:
<Slider module="ui"/>
in the ui.js lib would be something like :
exports.createSlider = function(){
   return Alloy.createController("ui/slider").getView();
}
The idea being I'd have a simple XML markup that would still say the name of the object (rather than using require) but have the benefit of using TSS, XML etc to create the element. (basically didn't want to use Require) It works as in it renders the view fine -- the issue is that any exceptions don't appear in the console and neither do any events work in the control -- so if I add ANY event listener in the control it never works. If I change the XML entry to:
<Require src="ui/slider"/>
and bypass the CommonJS lib, it works fine.

Comments

  1. Sharif AbuDarda 2016-06-14

    Hello, This is how the Alloy XML markup works. It's started from Alloy 1.2.0. You have to use the require. This is not a bug. For reference please follow the link http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_XML_Markup-section-46248608_AlloyXMLMarkup-RequireElement

JSON Source