Sorry for the vague/unclear title but I could not think of a 'one line says it al' kind of title. My problem is that I've loaded data from a database into several arrays. With a forloop I create several buttons with the following code:
productButtons[i] = Titanium.UI.createView({
    width:"100%",
    height:"90",
    top:90*i,
    link:positionInArray,
    backgroundImage:"/images/menu/itemBackground.png",
    backgroundSelectedImage:"/images/menu/itemBackground-over.png"
});
productButtons[i].addEventListener('click', function(e) {
    var productLocation = {link:e.source.link};
    var productScrn = Alloy.createController('product',productLocation).getView();
    productScrn.open();
});
I've read somewhere that you could create your custom vars and add them to a view, like I do above with 'link'. So when the button (or view) is clicked, I try to retrieve the link of the view by storing it in the productLocation var using e.source.link.
I capture the passed var in the productScrn using:
var args = arguments[0] || {};
var productLocation = args.link;
But when I log or alert the new productLocation variable in the newly opened screen, 9 out of 10 times it returns undefined. How can this be?I've tested with replacing e.source.link for a number which does seem to work. So is my custom variable in the createView incorrect?
Cheers!
