Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Alloy Data Binding Annotations

$
0
0

I try to use annotations as a collection inside a ti.map module Modules.Map.View.

Documentation says this is possible as of Alloy 1.4: Alloy_Data_Binding

Please consider the following in my view xml:

<Alloy>
    <Collection src="pins" />
    <Window id="map" class="container">
 
        <!-- DOES NOT WORK -->
        <View id="mapView" module="ti.map" dataCollection="pins">
            <Annotation latitude="{lat}" longitude="{lon}" title="{id}" />
        </View>
 
        <!-- DOES NOT WORK -->
        <!--Module module="ti.map" method="createView" id="mapView" dataCollection="pins">
            <Annotation latitude="{lat}" longitude="{lon}" title="{id}" />
        </Module-->
 
        <!-- WORKS -->
        <!--TableView dataCollection="pins">
            <TableViewRow title="{id}" latitude="{lat}" longitude="{lon}" />
        </TableView-->
 
    </Window>
</Alloy>
In my controller I do a
Alloy.Collections.pins.fetch();
Everything works fine for the above TableView.

However for both above $.mapView's which contain the same dataCollection attribute as the TableView, I get the following error:

[ERROR] message = "null is not an object (evaluating '$model.__transform')";
Which according to Tony Lukasavage comment in the following post undefined-is-not-an-object-evaluating-modeltransform means: "...you're attempting to use data binding notation on elements that are not inside an element with a dataCollection..."

I am using Ti SDK 3.5.1.GA and Alloy 1.5.1, testing on iOS Simulator 8.2

Does anybody succesfully used Annotations for a dataCollection as of Alloy 1.4+?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>