Titanium JIRA Archive
Alloy (ALOY)

[ALOY-443] Enable more complex notation in binding

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-07-16T16:43:58.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.5.0
ComponentsModels, XML
Labelsnotable, qe-automation, qe-manualtest
ReporterTony Lukasavage
AssigneeFeon Sua Xin Miao
Created2012-12-21T13:41:13.000+0000
Updated2016-03-16T12:55:33.000+0000

Description

Allow developers to use syntax like the following in collection/model bindings:
<Alloy>
    <Model src="someModel"/>
    <Window title="{someModel.title} {someModel.subtitle}"/>
</Alloy>
Basically, instead of assuming the whole property needs to be wrapped in \{\}, allow developers to put as many of them in the attribute as they want.

Comments

  1. Tony Lukasavage 2013-04-05

    ALOY-599 is mostly a duplicate of this ticket but also includes additional information regarding its usage. They should probably be separated into multiple tickets, but for now I'll simply leave this linked ticket here.
  2. Feon Sua Xin Miao 2014-07-15

    PR: https://github.com/appcelerator/alloy/pull/479 Test app: https://github.com/feons/alloy/tree/ALOY-443/test/apps/testing/ALOY-443 Functional Test: 1. Run the test app on iOS 2. There are multiple data binding notation in the tag attribute, data should be displayed without {}. These 3 test cases failed, which is expected because there are some changes in the generated code. {noformat} advanced/proxy_property_requires [android] matches known good generated code for alloy/widgets/com.foo.widget/controllers/row_bind.js advanced/proxy_property_requires [ios] matches known good generated code for alloy/widgets/com.foo.widget/controllers/row_bind.js advanced/proxy_property_requires [mobileweb] matches known good generated code for alloy/widgets/com.foo.widget/controllers/row_bind.js {noformat}
  3. Tim Poulsen 2014-07-15

    Was your intention that this PR support the notation formats shown in ALOY-599? Such as:
       <Label>{book.title}</Label>
       <Label>Written by {book.author}</Label>
       
    (It does not) Would you also open a separate ticket to update the _generated code for the advanced/proxy_property_requires test app?
  4. Feon Sua Xin Miao 2014-07-16

    I'll open a separate ticket to update _generated code. Thanks Tim!
  5. Feon Sua Xin Miao 2014-07-16

    Updated PR to support these:
       <Label>{book.title}</Label>
       <Label>Written by {book.author}</Label>
       
  6. Tim Poulsen 2014-07-16

    PR merged
  7. Federico Casali 2014-08-07

JSON Source