0

Passing Image from one view to another

Hi All,
Currently I'm having difficulty trying to pass Image param to another view. I am able to do it for Text, but as for image, i couldn't figure out how I can do it. Any help is appreciated, Thanks!

Below is the code I'm using:

CODEBOX
				
var cell = new KONtx.control.GridCell({

styles: {
width: this.width
},

events: {

onSelect: function () {
KONtx.application.loadView('view-NewsDetail', {title: this.title.data,
description: this.description.data,
enclosure: this.enclosure.data //this shld contain image i'm trying to pass
});

},

}

});

..................

cell.enclosure = new KONtx.element.Image({

styles: {

width: 55,
height: 42,
backgroundColor: '#EEEEEE',

hOffset: 7,

vOffset: 7

}

}).appendTo(cell);


Here, I'm trying to get the data in another class
CODEBOX
	
updateView: function() {
this.controls.title.setText(this.persist.title);
this.controls.description.setText(this.persist.description);
this.controls.enclosure.setSource(this.persist.enclosure);
},

by
2 Replies
  • Not sure what the data looks like you are pluggin into, but the ".data" seems a bit strange to grab an image src. I am imagining that the this.title and this.description are Text() objects. For an Image() you would use the .src value.

    CODE
    {title: this.title.data,
    description: this.description.data,
    enclosure: this.enclosure.src}
    0
  • QUOTE (WidgetRealm @ Feb 21 2011, 09:11 AM) <{POST_SNAPBACK}>
    Not sure what the data looks like you are pluggin into, but the ".data" seems a bit strange to grab an image src. I am imagining that the this.title and this.description are Text() objects. For an Image() you would use the .src value.

    CODE
    {title: this.title.data,
    description: this.description.data,
    enclosure: this.enclosure.src}

    Geez, that did the trick. Thanks again WidgetRealm!
    0

Recent Posts

in General - Yahoo! TV Widgets