[ALOY-1253] Alloy: Support WPATH in widget XML view attribute values
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-08-12T14:52:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | CLI Release 8.1.0 |
Components | XML |
Labels | griffin-app, merge-to-next, view, widgets, wpath |
Reporter | Fokke Zandbergen |
Assignee | Brenton House |
Created | 2015-02-20T14:57:14.000+0000 |
Updated | 2020-08-12T14:52:52.000+0000 |
Description
At the moment you cannot use WPATH in a widget's XML view. You need to set them via TSS. Which is OK, but some like to do so in XML, like they're used to do in HTML.
*widget.js*
<Alloy>
<ImageView id="image" image="WPATH('images/a.png')" />
</Alloy>
*compiled widget.js*
$.__views.image = Ti.UI.createImageView({
image: "WPATH('images/a.png')",
id: "image"
});
*working widget.tss*
"ImageView": {
image: WPATH('images/a.png')
}
Seems like maybe this one fell through the cracks. I will create a quick PR for it.
[~eharris] - Created PR: https://github.com/appcelerator/alloy/pull/948
Test steps: Grab the [basic widget sample](https://github.com/appcelerator/alloy/tree/master/samples/apps/widgets/basic) and convert to use WPATH [here](https://github.com/appcelerator/alloy/blob/master/samples/apps/widgets/basic/widgets/com.foo.widget/views/image.xml#L2) instead of the widget ID After changing that it should function the same as before
Closing ticket, fix verified in CLI version 8.1.0-master.10, tested using the example widgets app. (https://github.com/brentonhouse/alloy-widget-test)