Note that there are some explanatory texts on larger screens.

plurals
  1. POTitanium Alloy ListView XML Uncaught TypeError: Object #<UI> has no method 'createTemplates'
    primarykey
    data
    text
    <p>I am new to Titanium, so excuse my lack of understanding.</p> <p>Even though I am using sdk version 3.2 (have sdk-version: 3.2.0.v20130801162445 in my tiapp.xml) when I try and have a view that uses the xml above I get this error: [ERROR][V8Exception( 615)] Exception occurred at alloy/controllers/feed.js:22: Uncaught TypeError: Object # has no method 'createTemplates'</p> <p>I cut down all my code so that the feed.js file is just:</p> <pre><code>function loadMoreBtnClicked(_event) { alert('not implemented yet'); } function createListView(_data) { // this is pretty straight forward, assigning the values to the specific // properties in the template we defined above var items = []; for (var i in _data) { // add items to an array items.push({ template : "template1", // set the template textLabel : { text : _data[i].name // assign the values from the data }, pic : { image : _data[i].pic_square // assign the values from the data } }); } // add the array, items, to the section defined in the feed.xml file $.section.setItems(items); } alert('feed loaded'); </code></pre> <p>The XML is in feed.xml and looks like this:</p> <pre><code>&lt;Alloy&gt; &lt;Window class="container" formFactor="handheld"&gt; &lt;ListView id="list" defaultItemTemplate="template1"&gt; &lt;Templates&gt; &lt;ItemTemplate name="buttonItem" height="Ti.UI.SIZE"&gt; &lt;!-- will use this in the next blog post --&gt; &lt;Button id="loadMoreBtn" onClick="loadMoreBtnClicked"&gt;Load More&lt;/Button&gt; &lt;/ItemTemplate&gt; &lt;!-- main template for displaying the list items --&gt; &lt;ItemTemplate id="template1" name="template1" class="template1"&gt; &lt;ImageView id="pic" bindId="pic" class="imageThumb"/&gt; &lt;View id="textContainer"&gt; &lt;Label id="textLabel" bindId="textLabel" class="title"/&gt; &lt;/View&gt; &lt;/ItemTemplate&gt; &lt;/Templates&gt; &lt;!-- we only have one section and the items are contstucted using template1 --&gt; &lt;ListSection id="section" &gt; &lt;ListItem template="template1" /&gt; &lt;/ListSection&gt; &lt;/ListView&gt; &lt;/Window&gt; &lt;/Alloy&gt; </code></pre> <p>I still get the error (just using the XML with no actual controller code other than the alert running). If I pull the ListView XML out of the feed.xml file the alert fires, when I put the ListView XML back in I get the Error above. </p> <p>I am trying to use code from this example: <a href="https://gist.github.com/aaronksaunders/5896390" rel="nofollow">https://gist.github.com/aaronksaunders/5896390</a> but cant really tell what I am missing?</p> <p>Thanks! -James</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload