[ALOY-547] TSS selector Widget doesn't work like Require does
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-18T21:15:11.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.1.0, 2013 Sprint 06 |
Components | Runtime, XML |
Labels | alloy, require, tss, widget |
Reporter | Fokke Zandbergen |
Assignee | Tony Lukasavage |
Created | 2013-03-04T13:48:07.000+0000 |
Updated | 2013-05-01T14:56:28.000+0000 |
Description
Assuming you have anindex.xml
like:
<Alloy>
<Window>
<Widget src="my.allow.widget" id="myId" />
</Window>
</Alloy>
And an index.tss
like:
"Widget": {
top: 50
}
The compiled index.js
will contain:
$.__views.myId = Alloy.createWidget("my.allow.widget", "widget", {
id: "myId"
});
While the following index.tss
:
"Require": {
top: 50
}
Results in the expected:
$.__views.myId = Alloy.createWidget("my.allow.widget", "widget", {
top: 50,
id: "myId"
});
I've ran into more examples where <Widget />
does not inherit all functionality of <Require />
in a correct way. Maybe it would be good idea just to replace <Widget />
by <Require type="widget" />
as the first step in compilation so we don't have to take care of <Widget />
anymore in the further compilation process?
Comments
- Tony Lukasavage 2013-03-18
If you look at the
parser, it is in fact just a call. The reason this issue surfaced is that I change the node name and type attribute to "widget" when I encounter the element, then pass the node into the parser, as widgets and requires are processed with the same parser. The problem with styling occurs because I later use a conditional based on the node name to determine what type of API is being styled. In your case above, the elements, but the time i was done manipulating, were actually . I made a fix to that conditional check and now you can generically apply styles to 's. - Federico Casali 2013-04-09 Verified fixed. Alloy 1.1.0-cr CLI version 3.1.0-cr TiSDK : 3.1.0.v20130408154547 (RC) Android and iOS